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

WMFP metric #293

Closed
wants to merge 6 commits into from
Closed

WMFP metric #293

wants to merge 6 commits into from

Conversation

Zener085
Copy link
Contributor

@yegor256 I introduce the new metric you mentioned here #26
My code contains 2 subfunctions for calculating some additional parameters and one main function that groups everything together and counts the final result.

Right now the function analyzes the following things in the code:

  • ClassDeclaration
  • Annotation
  • FieldDeclaration
  • MethodDeclaration
  • ReferenceType
  • VariableDeclarator
  • BasicType
  • Literal
  • ReturnStatement
  • Literal
  • TypeParameter

Only these features are considered because I found them in test case.

Note: The main function has a hyperparameter 0.65 in calculating complexity adjustment factor stage. In the description it's said we can use some parameters like this one for manipulating the total count. This number exactly is taken randomly, thus, maybe it's needed to be changed later or even removed.

+ Added new metric wmfp with subjective coefficient 0.65
+ Added test for the metric
+ Updated return types for nested functions
+ Updated types of values inside `statements` and `variables` parameters
+ added return annotations for the 2 subfunctions
+ Added space for the test, maybe the problem was here
@Zener085
Copy link
Contributor Author

I apologize for the premature timing PR, when running locally I didn’t notice any problems with the make, I’ll re-open it as soon as I fix the error

@Zener085 Zener085 closed this Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant