-
Notifications
You must be signed in to change notification settings - Fork 49
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
Implement metrics for Java code #359
Comments
As part of fixing this, we can write some docs on how to add a new language. |
I would like to pick this up but not too sure what it entails. I have been looking through the implementations and think I understand some of it. I have only been learning Rust for a few weeks so it might take a while but since this has been open for almost a year I imagine it is not urgent. Eventually, I would like to add Go and C# but it appears Java has some implementation already so I thought this would be a good place to start. I could start with investigating the different elements that need implementing and documenting those if it does not exist already? This could for the basis of documentation mentioned. |
Hello! Thanks for your help! :) Well, for now Java has only some utilities functions, as you can see in the
|
Entirely possible I am missing something here and this all exists but the metrics seem to rely on some sort of language grammar being generated? I imagined it is going to be fairly iterative. A few docs I can imagine:
With the rough sketch of how things work done here, I write it up so I am explaining it back to you to be sure I understand. Then I implement and come back and flesh out the docs with more detail as I learn. Of course with enough help I am sure we could document it all up front, it just was not how I imagined doing it when I started poking around. Something I probably need to look into is more on how Rust generates its docs. Is that far off what you imagined? |
@marco-c Sure! @dburriss If you want to add a new
For the
For the At this point, you should be able to compile I completely agree with your docs, I think they could be pretty helpful for the new contributors, especially the tutorial style. We can add them into our official docs that are all defined here If you need some help, feel free to ask anytime |
I wanted to check some assumptions: for (int i = 0; i < 100; i++) {
System.out.println(i);
} For LLOC, the value should be 4? 3 for the statements inside the Another check? class HelloWorldApp {
public static void main(String[] args) {
System.out.println(\"Hello World!\"); // Display the string.
}
} How many LLOC does the above have? Put another way, do package NS, class declaration, and members count toward LLOC? Currently, mine is counting 2 for the above but I think it should only be the 1 P.S. I cannot set debug points inside the |
Exactly, in this case
First of all, we should ask: what are statements in Java? I found this article from Oracle. In the case above, only the
Yep, we have updated master to the new Rust version such that the |
Hi. Working on this again. if (x == 1) Is one logical line. if ( (x == 1) || (x==2) ) I had assumed this was 2 logical lines but reading the link from @Luni-4 I am thinking I may have been wrong. Although it never talks about the semantics of a compound predicate, my understanding now is that it is a single expression and so a single logical line. Do you agree? |
I believe it is to be considered a single lloc. I guess you can confirm with a C++ snippet, which should be exactly the same in this case. |
#786 is adding support for cyclomatic complexity calculation for Java. |
#694 added loc metrics. |
#811 adds Halstead metrics |
#823 Adds nom metrics |
#822 Adds exit metrics |
|
OK, let's close this and consider that as a separate follow-up bug that we have to fix. |
Currently no metrics have been implemented for the
Java
codeThe text was updated successfully, but these errors were encountered: