context.saveMeasure(sonarFile, CoreMetrics.COMPLEXITY, squidFile.getDouble(EcmaScriptMetric.COMPLEXITY));
context.saveMeasure(sonarFile, CoreMetrics.COMMENT_LINES, squidFile.getDouble(EcmaScriptMetric.COMMENT_LINES));
}
private void saveClassComplexity(org.sonar.api.resources.File sonarFile, SourceFile squidFile) {
Collection<SourceCode> classes = scanner.getIndex().search(new QueryByParent(squidFile), new QueryByType(SourceClass.class));
double complexityInClasses = 0;
for (SourceCode squidClass : classes) {
double classComplexity = squidClass.getDouble(EcmaScriptMetric.COMPLEXITY);
complexityInClasses += classComplexity;
}