I counted the number of Java projects and the result was 554.864.
In the query below, the number of projects with at minimum one valid Java file in the last snapshot was 274.989 (263.426 projects with at minimum one import and 11.563 without imports).
Are my results correct? I have 279.875 projects (554.864 - 274.989) without valid Java files in the latest snapshot.
java_projects_valid : output sum of int ;
java_projects_valid_without_imports: output sum of int ;
java_projects_valid_with_imports: output sum of int ;
all_projects: output sum of int ;
isProjectJavaValid := false;
containsImport := false;
all_projects << 1 ;
visit ( p , visitor {
before node: CodeRepository -> {
snapshot := getsnapshot(node, "SOURCE_JAVA_JLS");
foreach (i: int; def(snapshot[i])){
isProjectJavaValid = true;
visit(snapshot[i]);
}
stop;
}
before node: ASTRoot -> {
if(len(node.imports) > 0){
containsImport = true;
}
}
});
if(containsImport){
java_projects_valid_with_imports << 1;
}
if(!containsImport && isProjectJavaValid ){
java_projects_valid_without_imports << 1;
}
if(isProjectJavaValid){
java_projects_valid << 1;
}