-
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
Initial Halstead implementation for Java #811
Initial Halstead implementation for Java #811
Conversation
Test exmaple: public static void main(String args[]) {
int a, b, c, avg;
a = 5; b = 5; c = 5;
avg = (a + b + c) / 3;
MessageFormat.format(\"{0}\", avg);
} I will get to this over the weekend and try to set my test up for expected numbers. |
@dburriss You can find what are operators and operands in these tests https://github.com/mozilla/rust-code-analysis/blob/master/src/ops.rs#L312 for different programming languages. First vec are operators and second one operands. |
@Luni-4 I have run into a weird issue. When parsing the first line
Note the operator: ; and unknown: ERROR ... probably related. There is no ; in the first line so this is throwing the count off. The example is valid Java... I compiled it. |
It's very likely a matter of adding |
Thanks @calixteman @Luni-4 I included a lot of comments and links, etc. in the code explaining what and why I am including different things. I didn't find definitive rules about what is included or excluded. |
09ad6fa
to
e05c6d2
Compare
Codecov Report
@@ Coverage Diff @@
## master #811 +/- ##
==========================================
- Coverage 41.24% 40.00% -1.25%
==========================================
Files 52 52
Lines 7201 7490 +289
Branches 1039 1041 +2
==========================================
+ Hits 2970 2996 +26
- Misses 3519 3782 +263
Partials 712 712
Continue to review full report at Codecov.
|
I looked at ops.rs and added a test but having some problems. Copying the existing tests quickly and filling in from the list above (or the code), I get the following error:
A few questions questions:
|
@Luni-4 this is failing on the ops.rs file you mentioned. Not something I introduced. The linter has an opinion on something. I can make the change in this PR but I'm not sure how this got in in the first place. New rule maybe? |
fadc2b8
to
2f8ef42
Compare
2f8ef42
to
a99ac77
Compare
a99ac77
to
1f14f48
Compare
Shuffled things around a bit and moved ops check to #849 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @dburriss for the delay, yeah, it's fine splitting up the two problems.
Just a final request and we can land this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @dburriss! Fine for me!
Some references: