Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing for paths with .java in the middle #112

Closed
doritosxxx opened this issue Oct 14, 2023 · 8 comments
Closed

Incorrect parsing for paths with .java in the middle #112

doritosxxx opened this issue Oct 14, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@doritosxxx
Copy link
Contributor

Reproducible in the repository scouter-project/scouter for example.

First 6 lines of file dataset/data/scouter-project/scouter/all.csv from dataset:

java_file,acoc,annts,attrs,blanks,CAMC,CAMC-cvc,cc,coc,comments,ctors,extnds,final,gnrcs,impls,java,LCOM5,LCOM5-cvc,loc,MMAC,MMAC-cvc,mncoc,mtds,mxcoc,ncss,NHD,NHD-cvc,sattrs,SCOM,SCOM-cvc,smtds
/scouter.server.boot/src/main/java/scouter/boot/Boot.java,4,0,1,11,-,-,9,12,17,0,0,0,0,0,-,-,-,64,-,-,2,1,6,38,-,-,0,-,-,3
/scouter.agent.java,-,-,-,4192,-,-,-,-,3918,-,-,-,-,-,-,-,-,25074,-,-,-,-,-,-,-,-,-,-,-,-
/scouter.client/src/scouter/client/model/PropertyData.java,0,0,2,2,-,-,1,0,17,1,0,0,0,0,-,-,-,9,-,-,0,0,0,6,-,-,0,-,-,0
/scouter.client/src/scouter/client/model/TextProxy.java,0,0,0,9,-,-,1,0,17,1,0,0,0,0,-,-,-,48,-,-,0,0,0,39,-,-,18,-,-,1

It is noticeable that a lot of metrics for file /scouter.agent.java were not computed. So I tried to find this file in the repo source. I found out that file dataset/github/scouter-project/scouter/scouter.agent.java is not a file but a directory that contains .java files such as:

dataset\github\scouter-project\scouter\scouter.agent.java\src\main\java\com\mongodb\connection\SplittablePayload.java
dataset\github\scouter-project\scouter\scouter.agent.java\src\main\java\reactor\core\publisher\ScouterOptimizableOperatorProxy.java
dataset\github\scouter-project\scouter\scouter.agent.java\src\main\java\scouter\AnyTrace.java

изображение

The solution is to add a verification that a path matches to file or directory but I'm afraid that it might slow down the computation.

@doritosxxx
Copy link
Contributor Author

Some lines from file dataset/data/apache/netbeans/all.csv

/java/selenium2.java,-,-,-,30,-,-,-,-,60,-,-,-,-,-,-,-,-,177,-,-,-,-,-,-,-,-,-,-,-,-
/java/jellytools.java,-,-,-,542,-,-,-,-,2067,-,-,-,-,-,-,-,-,2487,-,-,-,-,-,-,-,-,-,-,-,-
/java/xml.tools.java,-,-,-,1000,-,-,-,-,1650,-,-,-,-,-,-,-,-,3647,-,-,-,-,-,-,-,-,-,-,-,-/java/performance.java,-,-,-,8555,-,-,-,-,52757,-,-,-,-,-,-,-,-,44296,-,-,-,-,-,-,-,-,-,-,-,-
/java/refactoring.java,-,-,-,8067,-,-,-,-,11130,-,-,-,-,-,-,-,-,50882,-,-,-,-,-,-,-,-,-,-,-,-/java/websvc.saas.codegen.java,-,-,-,514,-,-,-,-,505,-,-,-,-,-,-,-,-,3220,-,-,-,-,-,-,-,-,-,-,-,-
/java/api.java,-,-,-,149,-,-,-,-,660,-,-,-,-,-,-,-,-,851,-,-,-,-,-,-,-,-,-,-,-,-
/java/spellchecker.bindings.java,-,-,-,136,-,-,-,-,76,-,-,-,-,-,-,-,-,454,-,-,-,-,-,-,-,-,-,-,-,-
/java/gradle.java,-,-,-,1150,-,-,-,-,2109,-,-,-,-,-,-,-,-,7662,-,-,-,-,-,-,-,-,-,-,-,-
/extide/options.java,-,-,-,1,-,-,-,-,25,-,-,-,-,-,-,-,-,4,-,-,-,-,-,-,-,-,-,-,-,-

@yegor256
Copy link
Owner

@doritosxxx indeed a bug, thanks for reporting!

@yegor256 yegor256 added the bug Something isn't working label Oct 17, 2023
@yegor256 yegor256 self-assigned this Oct 17, 2023
yegor256 added a commit that referenced this issue Oct 17, 2023
@yegor256
Copy link
Owner

@doritosxxx fixed in 90b8598

@doritosxxx
Copy link
Contributor Author

@yegor256
It seems that you may have inadvertently swapped the arguments here.

90b8598#diff-ae4c299a7984124578172fd974aee58e79ba3093fa0295f35381a7b0c5319732R57

@doritosxxx
Copy link
Contributor Author

Made a quick fix f19c2ac

@yegor256
Copy link
Owner

@rultor release, tag is 0.7.1

@rultor
Copy link
Collaborator

rultor commented Oct 18, 2023

@rultor release, tag is 0.7.1

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented Oct 18, 2023

@rultor release, tag is 0.7.1

@yegor256 Done! FYI, the full log is here (took me 49min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants