Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/python/evaluation/inspectors/inspectors_stat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ More information about these categories can be found on [this](https://support.h

The current statistics is:

| Error prone | Code style | Code complexity | Best practice
---------------| -----------|-------------|-----------------|--------------
| Python | 162 | 146 | 35 | 254 |
| Java | 105 | 133 | 15 | 203 |
| JavaScript | 15 | 17 | 1 | 34 |
| Kotlin | 21 | 70 | 12 | 75 |
| | Error prone | Code style | Code complexity | Best practice |
|------------|:-----------:|:----------:|:---------------:|:-------------:|
| Python | 162 | 146 | 35 | 254 |
| Java | 51 | 50 | 8 | 110 |
| JavaScript | 15 | 17 | 1 | 34 |
| Kotlin | 21 | 70 | 12 | 75 |


## Usage
Expand All @@ -42,4 +42,4 @@ complexity: 35 times;
error prone: 162 times;
undefined: 3 times;
Note: undefined means a category that is not categorized among the four main categories. Most likely it is info category
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def collect_stat_by_language(language: Language) -> IssuesStat:
elif language == Language.JAVA:
java_inspection_to_matcher = [
(set(PMD_RULE_TO_ISSUE_TYPE.keys()), PMDInspector.choose_issue_type),
(set(CHECK_CLASS_NAME_TO_ISSUE_TYPE.keys() - set(CheckstyleInspector.skipped_issues)),
CheckstyleInspector.choose_issue_type),
(set(CHECK_CLASS_NAME_TO_ISSUE_TYPE.keys()), CheckstyleInspector.choose_issue_type),
]
return __collect_language_stat(*java_inspection_to_matcher)
elif language == Language.KOTLIN:
Expand Down
2 changes: 2 additions & 0 deletions src/python/review/inspectors/checkstyle/files/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<module name="Checker">
<property name="fileExtensions" value="java"/>

<!-- This config was created using the following table: https://bit.ly/3BbxmD5 -->

<!-- Size Violations -->
<module name="LineLength">
<property name="max" value="120"/>
Expand Down
8 changes: 4 additions & 4 deletions src/python/review/inspectors/checkstyle/issue_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'ArrayTrailingCommaCheck': IssueType.INFO,
'CovariantEqualsCheck': IssueType.ERROR_PRONE,
'DefaultComesLastCheck': IssueType.BEST_PRACTICES,
'EmptyStatementCheck': IssueType.BEST_PRACTICES,
'EmptyStatementCheck': IssueType.ERROR_PRONE,
'EqualsAvoidNullCheck': IssueType.BEST_PRACTICES,
'EqualsHashCodeCheck': IssueType.ERROR_PRONE,
'FallThroughCheck': IssueType.ERROR_PRONE,
Expand Down Expand Up @@ -193,12 +193,12 @@
# 'MethodCountCheck': IssueType.CODE_STYLE,
# 'MethodLengthCheck': IssueType.BEST_PRACTICES,
# 'OuterTypeNumberCheck': IssueType.CODE_STYLE,
'ParameterNumberCheck': IssueType.BEST_PRACTICES,
'ParameterNumberCheck': IssueType.COMPLEXITY,
# 'RecordComponentNumberCheck': IssueType.BEST_PRACTICES,

# ---- Whitespace ----
'EmptyForIteratorPadCheck': IssueType.BEST_PRACTICES,
'EmptyLineSeparatorCheck': IssueType.BEST_PRACTICES,
'EmptyForIteratorPadCheck': IssueType.CODE_STYLE,
'EmptyLineSeparatorCheck': IssueType.CODE_STYLE,
'GenericWhitespaceCheck': IssueType.CODE_STYLE,
'MethodParamPadCheck': IssueType.CODE_STYLE,
'NoWhitespaceAfterCheck': IssueType.CODE_STYLE,
Expand Down
2 changes: 2 additions & 0 deletions src/python/review/inspectors/flake8/issue_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
'C818': IssueType.CODE_STYLE,
'C819': IssueType.CODE_STYLE,

# The categorization for WPS was created using the following document: https://bit.ly/3yms06n

# WPS: Naming
'WPS117': IssueType.CODE_STYLE, # Forbid naming variables self, cls, or mcs.
'WPS125': IssueType.ERROR_PRONE, # Forbid variable or module names which shadow builtin names.
Expand Down
2 changes: 2 additions & 0 deletions src/python/review/inspectors/pmd/files/bin/basic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
The Basic ruleset contains a collection of good practices which should be followed.
</description>

<!-- This config was created using the following table: https://bit.ly/2VC6E61 -->

<!-- Best Practices -->
<rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod"/>
<rule ref="category/java/bestpractices.xml/AccessorClassGeneration"/>
Expand Down
16 changes: 8 additions & 8 deletions src/python/review/inspectors/pmd/issue_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'AvoidReassigningCatchVariables': IssueType.BEST_PRACTICES,
'AvoidReassigningLoopVariables': IssueType.BEST_PRACTICES,
'AvoidReassigningParameters': IssueType.BEST_PRACTICES,
'AvoidStringBufferField': IssueType.BEST_PRACTICES,
'AvoidStringBufferField': IssueType.ERROR_PRONE,
'AvoidUsingHardCodedIP': IssueType.BEST_PRACTICES,
'CheckResultSet': IssueType.BEST_PRACTICES,
'ConstantsInInterface': IssueType.BEST_PRACTICES,
Expand Down Expand Up @@ -63,9 +63,9 @@
# ---- Code Style ----
'AvoidDollarSigns': IssueType.CODE_STYLE,
'AvoidProtectedFieldInFinalClass': IssueType.BEST_PRACTICES,
'AvoidProtectedMethodInFinalClassNotExtending': IssueType.CODE_STYLE,
'AvoidProtectedMethodInFinalClassNotExtending': IssueType.BEST_PRACTICES,
'BooleanGetMethodName': IssueType.CODE_STYLE,
'CallSuperInConstructor': IssueType.CODE_STYLE,
'CallSuperInConstructor': IssueType.BEST_PRACTICES,
'ClassNamingConventions': IssueType.CODE_STYLE,
'ControlStatementBraces': IssueType.CODE_STYLE,
'EmptyMethodInAbstractClassShouldBeAbstract': IssueType.BEST_PRACTICES,
Expand Down Expand Up @@ -124,9 +124,9 @@
'AvoidUncheckedExceptionsInSignatures': IssueType.BEST_PRACTICES,
'CollapsibleIfStatements': IssueType.BEST_PRACTICES,
'DoNotExtendJavaLangError': IssueType.BEST_PRACTICES,
'ExcessiveParameterList': IssueType.BEST_PRACTICES,
'ExcessivePublicCount': IssueType.BEST_PRACTICES,
'GodClass': IssueType.BEST_PRACTICES,
'ExcessiveParameterList': IssueType.COMPLEXITY,
'ExcessivePublicCount': IssueType.COMPLEXITY,
'GodClass': IssueType.COMPLEXITY,
'LogicInversion': IssueType.BEST_PRACTICES,
'SimplifiedTernary': IssueType.BEST_PRACTICES,
'SimplifyBooleanAssertion': IssueType.BEST_PRACTICES,
Expand Down Expand Up @@ -205,7 +205,7 @@
'EmptyIfStmt': IssueType.BEST_PRACTICES,
'EmptyInitializer': IssueType.BEST_PRACTICES,
'EmptyStatementBlock': IssueType.BEST_PRACTICES,
'EmptyStatementNotInLoop': IssueType.BEST_PRACTICES,
'EmptyStatementNotInLoop': IssueType.ERROR_PRONE,
'EmptySwitchStatements': IssueType.BEST_PRACTICES,
'EmptySynchronizedBlock': IssueType.BEST_PRACTICES,
'EmptyTryBlock': IssueType.BEST_PRACTICES,
Expand All @@ -216,7 +216,7 @@
'FinalizeOverloaded': IssueType.ERROR_PRONE,
'FinalizeShouldBeProtected': IssueType.ERROR_PRONE,
'IdempotentOperations': IssueType.BEST_PRACTICES,
'InstantiationToGetClass': IssueType.ERROR_PRONE,
'InstantiationToGetClass': IssueType.BEST_PRACTICES,
'JumbledIncrementer': IssueType.ERROR_PRONE,
'MethodWithSameNameAsEnclosingClass': IssueType.BEST_PRACTICES,
'MisplacedNullCheck': IssueType.ERROR_PRONE,
Expand Down