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

Instancing Rework #510

Draft
wants to merge 16 commits into
base: next
Choose a base branch
from

Merge branch 'next' into instancing-rework

f016e7b
Select commit
Loading
Failed to load commit list.
Draft

Instancing Rework #510

Merge branch 'next' into instancing-rework
f016e7b
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (next) failed Nov 16, 2024 in 58s

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) ๐Ÿ”ฅ

View detailed results in CodeScene

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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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.