Instancing Rework #510
Instancing Rework #510
CodeScene PR Check
โ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.01 (6.07 -> 6.08)
- Declining Code Health: 5 findings(s) ๐ฉ
- Improving Code Health: 21 findings(s) โ
- Affected Hotspots: 3 files(s) ๐ฅ
Details
๐ฉ Declining Code Health (highest to lowest):
- Complex Method PlayerItemInstanceRegistry.java: getCachedItemInstance
- Complex Conditional ClientEventHandler.java: update ๐ฅ
- Complex Method PlayerItemInstanceRegistry.java: createItemInstance
- Bumpy Road Ahead PlayerItemInstanceRegistry.java: createItemInstance
- Bumpy Road Ahead PlayerItemInstanceRegistry.java: getCachedItemInstance
โ Improving Code Health:
- Complex Conditional WeaponRenderer.java: getNextNonExpiredState ๐ฅ
- Overall Code Complexity PlayerItemInstanceRegistry.java
- Lines of Code in a Single File Weapon.java ๐ฅ
- Lines of Code in a Single File WeaponRenderer.java ๐ฅ
- Complex Method GrenadeRenderer.java: renderCompatibleAttachment
- Primitive Obsession PlayerWeaponInstance.java
- Number of Functions in a Single Module WeaponRenderer.java ๐ฅ
- Bumpy Road Ahead GrenadeRenderer.java: renderCompatibleAttachment
- Complex Method PlayerItemInstanceRegistry.java: getItemInstance
- Complex Method PlayerItemInstanceRegistry.java: getItemInstance
- Complex Method PlayerItemInstanceRegistry.java: update
- Complex Method PlayerWeaponInstance.java: getRequiredPerspectiveType
- Bumpy Road Ahead PlayerItemInstanceRegistry.java: getItemInstance
- Complex Conditional PlayerItemInstanceRegistry.java: getItemInstance
- Complex Conditional PlayerItemInstanceRegistry.java: update
- Deep, Nested Complexity PlayerItemInstanceRegistry.java: getItemInstance
- Complex Conditional PlayerWeaponInstance.java: addStateToHistory
- Bumpy Road Ahead PlayerWeaponInstance.java: addStateToHistory
- Bumpy Road Ahead PlayerWeaponInstance.java: reconcile
- Bumpy Road Ahead PlayerGrenadeInstance.java: getActiveAttachments
- Primitive Obsession PlayerGrenadeInstance.java
Annotations
Check warning on line 167 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting worse: Complex Method
createItemInstance increases in cyclomatic complexity from 9 to 11, 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 122 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting better: Complex Method
getItemInstance decreases in cyclomatic complexity from 17 to 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 101 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Method
getItemInstance 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 324 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Method
update 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 warning on line 220 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ New issue: Complex Method
getCachedItemInstance has a cyclomatic complexity of 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 notice on line 214 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Conditional
getItemInstance no longer has a complex conditional
Check notice on line 271 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Conditional
update no longer has a complex conditional
Check notice on line 101 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Bumpy Road Ahead
getItemInstance is no longer above the threshold for logical blocks with deeply nested code. 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 warning on line 167 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ New issue: Bumpy Road Ahead
createItemInstance has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested 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 warning on line 220 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ New issue: Bumpy Road Ahead
getCachedItemInstance has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested 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/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 8.11 to 5.17, 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 notice on line 101 in src/main/java/com/paneedah/weaponlib/PlayerItemInstanceRegistry.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Deep, Nested Complexity
getItemInstance is no longer above the threshold for nested complexity depth
Check notice on line 1 in src/main/java/com/paneedah/weaponlib/WeaponRenderer.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting better: Lines of Code in a Single File
The lines of code decreases from 3007 to 2993, 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 better: Number of Functions in a Single Module
The number of functions decreases from 224 to 223, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check notice on line 2590 in src/main/java/com/paneedah/weaponlib/WeaponRenderer.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Conditional
getNextNonExpiredState no longer has a complex conditional. 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 861 in src/main/java/com/paneedah/weaponlib/grenade/GrenadeRenderer.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Method
renderCompatibleAttachment 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 861 in src/main/java/com/paneedah/weaponlib/grenade/GrenadeRenderer.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Bumpy Road Ahead
renderCompatibleAttachment is no longer above the threshold for logical blocks with deeply nested code. 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 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.19, 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 notice on line 437 in src/main/java/com/paneedah/weaponlib/PlayerWeaponInstance.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Method
getRequiredPerspectiveType 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 151 in src/main/java/com/paneedah/weaponlib/PlayerWeaponInstance.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Complex Conditional
addStateToHistory no longer has a complex conditional
Check notice on line 157 in src/main/java/com/paneedah/weaponlib/PlayerWeaponInstance.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Bumpy Road Ahead
addStateToHistory is no longer above the threshold for logical blocks with deeply nested code
Check notice on line 522 in src/main/java/com/paneedah/weaponlib/PlayerWeaponInstance.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ No longer an issue: Bumpy Road Ahead
reconcile is no longer above the threshold for logical blocks with deeply nested code
Check notice on line 1 in src/main/java/com/paneedah/weaponlib/PlayerWeaponInstance.java
codescene-delta-analysis / CodeScene Cloud Delta Analysis (next)
โ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 63.41% to 50.00%, 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.