Overhauled EOTech Holographics #482
CodeScene PR Check
โ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.14 (5.91 -> 5.77)
- Declining Code Health: 9 findings(s) ๐ฉ
- Improving Code Health: 17 findings(s) โ
- Affected Hotspots: 8 files(s) ๐ฅ
Details
๐ฉ Declining Code Health (highest to lowest):
- Complex Method TileEntities.java: init
- Low Cohesion CustomArmor.java ๐ฅ
- Complex Method AnimationModeProcessor.java: onTick
- Complex Method ItemVest.java: ItemVest.Builder.build ๐ฅ
- Complex Conditional ClientEventHandler.java: update ๐ฅ
- Primitive Obsession WeaponRenderer.java ๐ฅ
- Primitive Obsession Button.java
- Primitive Obsession SpriteSheetTools.java
- Constructor Over-Injection QBoxer.java: QBoxer
โ Improving Code Health:
- Overall Code Complexity GUIContainerStation.java
- Complex Method Electronics.java: createEquipment
- Large Method Vests.java: createEquipment
- Large Method Armors.java: createEquipment
- Complex Conditional AnimationModeProcessor.java: onTick
- Primitive Obsession AnimationModeProcessor.java
- Primitive Obsession Panel.java
- Primitive Obsession AnimationData.java
- Primitive Obsession GUIContainerStation.java
- Large Method Backpacks.java: createEquipment
- Bumpy Road Ahead WeaponReloadAspect.java: getNextMagazine ๐ฅ
- Bumpy Road Ahead WeaponReloadAspect.java: getNextBestMagazineStack ๐ฅ
- Large Method TileEntities.java: createTileEntity
- Overall Code Complexity AnimationModeProcessor.java
- Code Duplication DebugPositioner.java
- Overall Code Complexity AnimationGUI.java
- Overall Code Complexity ModificationGUI.java ๐ฅ
Annotations
Check notice on line 68 in src/main/java/com/paneedah/mwc/equipment/Armors.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Large Method
createEquipment is no longer above the threshold for lines of code. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check notice on line 68 in src/main/java/com/paneedah/mwc/equipment/Armors.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน New issue: Large Method
init has 137 lines, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check notice on line 25 in src/main/java/com/paneedah/mwc/equipment/Backpacks.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Large Method
createEquipment is no longer above the threshold for lines of code. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check notice on line 25 in src/main/java/com/paneedah/mwc/equipment/Backpacks.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน New issue: Large Method
init has 97 lines, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check notice on line 208 in src/main/java/com/paneedah/mwc/equipment/Electronics.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Method
createEquipment is no longer above the threshold for cyclomatic complexity. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 208 in src/main/java/com/paneedah/mwc/equipment/Electronics.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน New issue: Complex Method
init has a cyclomatic complexity of 16, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 233 in src/main/java/com/paneedah/mwc/equipment/Vests.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Large Method
createEquipment is no longer above the threshold for lines of code. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check notice on line 233 in src/main/java/com/paneedah/mwc/equipment/Vests.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน New issue: Large Method
init has 163 lines, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check notice on line 1 in src/main/java/com/paneedah/mwc/tileentities/TileEntities.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Lines of Code in a Single File
The lines of code increases from 1412 to 1899, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
Check warning on line 1863 in src/main/java/com/paneedah/mwc/tileentities/TileEntities.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ New issue: Complex Method
init has a cyclomatic complexity of 121, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 1863 in src/main/java/com/paneedah/mwc/tileentities/TileEntities.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Large Method
createTileEntity is no longer above the threshold for lines of code
Check notice on line 88 in src/main/java/com/paneedah/mwc/utils/MWCUtil.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน New issue: Complex Method
consumeItemsFromPlayerInventory has a cyclomatic complexity of 9, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 247 in src/main/java/com/paneedah/weaponlib/ClientEventHandler.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Complex Method
update increases in cyclomatic complexity from 13 to 14, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check warning on line 247 in src/main/java/com/paneedah/weaponlib/ClientEventHandler.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting worse: Complex Conditional
update increases from 1 complex conditionals with 3 branches to 1 complex conditionals with 4 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
Check notice on line 1 in src/main/java/com/paneedah/weaponlib/ClientEventHandler.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 5.14 to 5.45, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
Check warning on line 1 in src/main/java/com/paneedah/weaponlib/CustomArmor.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ New issue: Low Cohesion
This module has at least 4 different responsibilities amongst its 59 functions, threshold = 3. Cohesion is calculated using the LCOM4 metric. Low cohesion means that the module/class has multiple unrelated responsibilities, doing too many things and breaking the Single Responsibility Principle.
Check warning on line 236 in src/main/java/com/paneedah/weaponlib/ItemVest.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting worse: Complex Method
ItemVest.Builder.build increases in cyclomatic complexity from 10 to 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 1 in src/main/java/com/paneedah/weaponlib/Weapon.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Lines of Code in a Single File
The lines of code increases from 1053 to 1104, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
Check notice on line 1 in src/main/java/com/paneedah/weaponlib/Weapon.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Number of Functions in a Single Module
The number of functions increases from 188 to 205, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check notice on line 539 in src/main/java/com/paneedah/weaponlib/WeaponReloadAspect.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Complex Method
getNextMagazine increases in cyclomatic complexity from 17 to 18, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 539 in src/main/java/com/paneedah/weaponlib/WeaponReloadAspect.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting better: Bumpy Road Ahead
getNextMagazine decreases from 3 to 2 logical blocks with deeply nested code, threshold is one single block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
Check notice on line 597 in src/main/java/com/paneedah/weaponlib/WeaponReloadAspect.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting better: Bumpy Road Ahead
getNextBestMagazineStack decreases from 3 to 2 logical blocks with deeply nested code, threshold is one single block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
Check notice on line 1 in src/main/java/com/paneedah/weaponlib/WeaponRenderer.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Lines of Code in a Single File
The lines of code increases from 3015 to 3072, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
Check notice on line 1 in src/main/java/com/paneedah/weaponlib/WeaponRenderer.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โน Getting worse: Number of Functions in a Single Module
The number of functions increases from 224 to 242, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check warning on line 1 in src/main/java/com/paneedah/weaponlib/WeaponRenderer.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ New issue: Primitive Obsession
In this module, 30.9% of all function arguments are primitive types, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.