-
Notifications
You must be signed in to change notification settings - Fork 30
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
Feature/1066/attribute descriptor for sourcecodeparser #3166
Merged
phanlezz
merged 9 commits into
main
from
feature/1066/attribute-descriptor-for-sourcecodeparser
Dec 9, 2022
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1a9ab14
Refactor some metric/attribute descriptions & titles
phanlezz 7dda500
Refactor deprecated toLowerCase -> lowercase
phanlezz 3a67e77
Add metric/attribute descriptors to source code parser
phanlezz 4502ba7
Refactor test-only method to be in the tests only
phanlezz 30f84af
Refactor rename test
phanlezz 9ffc41e
Add test case for partially included metrics in descriptors, fix typo
phanlezz 34c9abb
Add changelog entry
phanlezz cd050a9
Refactor the definition of max_function_mcc in SourceMonitorImporter
phanlezz f7eb9ae
Merge branch 'main' into feature/1066/attribute-descriptor-for-source…
MW-Friedrich File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../main/kotlin/de/maibornwolff/codecharta/importer/sourcecodeparser/AttributeDescriptors.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.maibornwolff.codecharta.importer.sourcecodeparser | ||
|
||
import de.maibornwolff.codecharta.model.AttributeDescriptor | ||
|
||
fun getAttributeDescriptors(): Map<String, AttributeDescriptor> { | ||
val descriptors = mutableMapOf<String, AttributeDescriptor>() | ||
val ghLink = "https://github.com/MaibornWolff/codecharta/blob/main/analysis/import/SourceCodeParser/README.md" | ||
descriptors["rloc"] = AttributeDescriptor(title = "Real Lines of Code", description = "Number of physical lines that contain at least one character which is neither a whitespace nor a tabulation nor part of a comment", link = ghLink) | ||
descriptors["classes"] = AttributeDescriptor(title = "Number of Classes", description = "Number of classes (including nested classes, interfaces, enums and annotations", link = ghLink) | ||
descriptors["functions"] = AttributeDescriptor(title = "Number of Functions", description = "Number of functions", link = ghLink) | ||
descriptors["statements"] = AttributeDescriptor(title = "Number of Statements", description = "Number of statements", link = ghLink) | ||
descriptors["comment_lines"] = AttributeDescriptor(title = "Comment Lines", description = "Number of lines containing either a comment or commented-out code", link = ghLink) | ||
descriptors["mcc"] = AttributeDescriptor(title = "Maximum Cyclic Complexity", description = "Maximum cyclic complexity based on paths through the code by McCabe", link = ghLink) | ||
descriptors["cognitive_complexity"] = AttributeDescriptor(title = "Cognitive Complexity", description = "How hard is it to understand the code's control flow", link = "https://www.sonarsource.com/resources/cognitive-complexity/") | ||
descriptors["commented_out_code_blocks"] = AttributeDescriptor(title = "Commented-out Code Blocks", description = "Number of blocks of commented-out code", link = ghLink) | ||
descriptors["max_nesting_level"] = AttributeDescriptor(title = "Maximum Nesting Level", description = "Maximum nested level/depth found", link = ghLink) | ||
descriptors["code_smell"] = AttributeDescriptor(title = "Code Smells", description = "Total count of code smell issues", link = ghLink) | ||
descriptors["security_hotspot"] = AttributeDescriptor(title = "Security Hotspots", description = "Number of security hotspots", link = ghLink) | ||
descriptors["vulnerability"] = AttributeDescriptor(title = "Number of Vulnerabilities", description = "Number of vulnerability issues", link = ghLink) | ||
descriptors["bug"] = AttributeDescriptor(title = "Number of Bugs", description = "Number of bug issues", link = ghLink) | ||
descriptors["sonar_issue_other"] = AttributeDescriptor(title = "Other Sonar Issues", description = "Total number of other sonar issues", link = ghLink) | ||
|
||
return descriptors.toMap() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In metricTitle.js: "Number of Code Lines with Comments"
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.
I prefer the current title, because it is shorter and still understandable.