88 ,package .fqn AS fullPackageName
99 ,package .name AS packageName
1010 ,sum (method .effectiveLineCount ) AS sumEffectiveLinesOfMethodCode
11+ ,sum (method .cyclomaticComplexity ) AS sumCyclomaticComplexity
1112 ,COUNT (DISTINCT method ) AS numberOfMethods
1213 ,reduce ( // Get the max effectiveLineCount of all methods in the package with the name and type of the method
1314 loc = { max : - 1 } , // initial object with max lines of code = -1
1617 THEN { max : m .method .effectiveLineCount , method : m .method , type : m .type } // then update the object
1718 ELSE loc // otherwise keep the object as it was
1819 END
19- ) AS methodWithMaxLoc
20+ ) AS methodWithMaxLinesOfCode
2021 ,reduce ( // Get the max cyclomaticComplexity of all methods in the package with the name and type of the method
2122 cmplx = { max : - 1 } , // initial object with max cyclomatic complexity = -1
2223 m IN collect ({ method : method , type : type } ) | // collect all methods and their types as objects
2728 ) AS methodWithMaxCyclomaticComplexity
2829RETURN artifactName , fullPackageName
2930 ,sumEffectiveLinesOfMethodCode AS linesInPackage
31+ ,sumCyclomaticComplexity AS complexityInPackage
3032 ,numberOfMethods AS methodCount
31- ,methodWithMaxLoc .max AS maxLinesMethod
32- ,methodWithMaxLoc .type .name AS maxLinesMethodType
33- ,methodWithMaxLoc .method .name AS maxLinesMethodName
33+ ,methodWithMaxLinesOfCode .max AS maxLinesMethod
34+ ,methodWithMaxLinesOfCode .type .name AS maxLinesMethodType
35+ ,methodWithMaxLinesOfCode .method .name AS maxLinesMethodName
3436 ,methodWithMaxCyclomaticComplexity .max AS maxComplexity
3537 ,methodWithMaxCyclomaticComplexity .type .name AS maxComplexityType
3638 ,methodWithMaxCyclomaticComplexity .method .name AS maxComplexityMethod
3739 ,packageName
38- ORDER BY sumEffectiveLinesOfMethodCode DESC , artifactName ASC , fullPackageName
40+ ORDER BY linesInPackage DESC , artifactName ASC , fullPackageName
0 commit comments