Standard Analyses

SemmleCode Professional comes with a wide range of pre-packaged analyses, from architectural properties and metrics, to statement-level checks for likely bugs and violations of best practice.


General Statistics

This query shows general statistics about the application, organised as a table.

How to Interpret the Query Results

Running this query on the source code of Roller produces the following table:

It shows the number of projects making up the application, the number of packages, compilation units, classes, interfaces, and methods, and the total number of source code resp. comment lines.

The self-containedness measure indicates how much the application depends on third-party libraries: low self-containedness means that many dependencies are to library classes (as opposed to source classes within the same application).

The final three statistics give estimates for development effort, development time, and average number of developers, based on the Basic Constructive Cost Model (COCOMO).

As the above table shows, Roller is a fairly small application that depends heavily on external libraries.

How to Address the Query Results

The results of this query are purely informative and more useful for getting an overall impression of the application than for identifying particular problems.

Source Code
import default

from string l, string n
where (l = "Number Of Projects" and 
         n = count(Project p).toString())
   or (l = "Number Of Packages" and
         n = count(Package p | p.fromSource()).toString())
   or (l = "Number Of CompilationUnits" and
         n = count(CompilationUnit cu | cu.fromSource()).toString())
   or (l = "Number Of Classes" and
         n = count(Class c | c.fromSource()).toString())
   or (l = "Number Of Interfaces" and
         n = count(Interface c | c.fromSource()).toString())
   or (l = "Number of Methods" and
         n = count(Callable c | c.fromSource()).toString())
   or (l = "Number of Lines Of Code" and
         n = sum(CompilationUnit cu | cu.fromSource() 
                                    | cu.getNumberOfLinesOfCode()).toString())
   or (l = "Number of Comment Lines" and
         n = sum(CompilationUnit cu | cu.fromSource() 
                                    | cu.getNumberOfCommentLines()).toString())
   or (l = "Self-Containedness" and
         n = (100 * sum(RefType t | t.fromSource() 
                                  | t.getMetrics().getEfferentSourceCoupling())
                  / sum(RefType t | t.fromSource() 
                                  | t.getMetrics().getEfferentCoupling())).toString() 
           + "%")
   or exists(BasicCOCOMO b |
                l = "Estimated Development Effort in Person-Months" and 
                n = b.getEffort("organic").toString()
             or l = "Estimated Development Time in Months" and 
                n = b.getDevelopmentTime("organic").toString()
             or l = "Estimated Average Number of Developers" and 
                n = b.getNumberOfRequiredPeople("organic").toString())
select l as Title, n as Value
References