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

Handle navigation updates in cache refeshers #17161

Merged

Update src/Umbraco.Core/Services/Navigation/ContentNavigationServiceB…

379552d
Select commit
Loading
Failed to load commit list.
Merged

Handle navigation updates in cache refeshers #17161

Update src/Umbraco.Core/Services/Navigation/ContentNavigationServiceB…
379552d
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v15/dev) failed Sep 30, 2024 in 1m 2s

CodeScene PR Check

Code Health Quality Gates: FAILED

Change in average Code Health of affected files: +0.17 (4.98 -> 5.15)

  • Declining Code Health: 11 findings(s) 🚩
  • Improving Code Health: 14 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Deep, Nested Complexity ContentCacheRefresher.cs: HandleNavigationForSingleContent
  • Deep, Nested Complexity MediaCacheRefresher.cs: HandleNavigationForSingleMedia
  • Complex Method ContentCacheRefresher.cs: HandleNavigationForSingleContent
  • Complex Method MediaCacheRefresher.cs: HandleNavigationForSingleMedia
  • Complex Method ContentCacheRefresher.cs: HandleNavigation
  • Complex Method MediaCacheRefresher.cs: HandleNavigation
  • Bumpy Road Ahead ContentCacheRefresher.cs: HandleNavigationForSingleContent
  • Bumpy Road Ahead MediaCacheRefresher.cs: HandleNavigationForSingleMedia
  • Bumpy Road Ahead ContentCacheRefresher.cs: HandleNavigation
  • Bumpy Road Ahead MediaCacheRefresher.cs: Refresh
  • Bumpy Road Ahead MediaCacheRefresher.cs: HandleNavigation

✅ Improving Code Health:

  • Lines of Code in a Single File ContentService.cs 🔥
  • Overall Code Complexity ContentService.cs 🔥
  • Number of Functions in a Single Module ContentService.cs 🔥
  • Primitive Obsession ContentNavigationServiceBase.cs
  • Complex Method ContentService.cs: Copy 🔥
  • Complex Method ContentService.cs: Save 🔥
  • Complex Method MediaCacheRefresher.cs: Refresh
  • Bumpy Road Ahead ContentService.cs: PerformMoveLocked 🔥
  • Bumpy Road Ahead ContentService.cs: Copy 🔥
  • Constructor Over-Injection MediaService.cs: MediaService
  • Constructor Over-Injection MediaService.cs: MediaService
  • Constructor Over-Injection ContentService.cs: ContentService 🔥
  • Constructor Over-Injection MediaService.cs: MediaService
  • Bumpy Road Ahead MediaService.cs: PerformMoveLocked

Annotations

Check warning on line 272 in src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Complex Method

HandleNavigationForSingleContent has a cyclomatic complexity of 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 warning on line 230 in src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Complex Method

HandleNavigation 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 warning on line 272 in src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Bumpy Road Ahead

HandleNavigationForSingleContent has 4 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 230 in src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Bumpy Road Ahead

HandleNavigation 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 272 in src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Deep, Nested Complexity

HandleNavigationForSingleContent has a nested complexity depth of 5, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.

Check notice on line 73 in src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

ℹ Getting worse: Constructor Over-Injection

ContentCacheRefresher increases from 9 to 11 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.

Check notice on line 1 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ Getting better: Lines of Code in a Single File

The lines of code decreases from 2302 to 2213, 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/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ Getting better: Number of Functions in a Single Module

The number of functions decreases from 109 to 108, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.

Check notice on line 2788 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ Getting better: Complex Method

Copy decreases in cyclomatic complexity from 15 to 13, 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 1060 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ Getting better: Complex Method

Save decreases in cyclomatic complexity from 13 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 2584 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ No longer an issue: Bumpy Road Ahead

PerformMoveLocked 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 2788 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ No longer an issue: Bumpy Road Ahead

Copy 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 1 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 4.21 to 4.16, 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 1 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

ℹ Getting worse: Primitive Obsession

The ratio of primitive types in function arguments increases from 50.00% to 50.16%, 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.

Check notice on line 69 in src/Umbraco.Core/Services/ContentService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ Getting better: Constructor Over-Injection

ContentService decreases from 15 to 14 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.

Check notice on line 1 in src/Umbraco.Core/Services/Navigation/ContentNavigationServiceBase.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ Getting better: Primitive Obsession

The ratio of primitive types in function arguments decreases from 50.85% to 48.39%, 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.

Check notice on line 123 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ No longer an issue: Complex Method

Refresh 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 215 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Complex Method

HandleNavigationForSingleMedia has a cyclomatic complexity of 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 warning on line 173 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Complex Method

HandleNavigation 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 warning on line 215 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Bumpy Road Ahead

HandleNavigationForSingleMedia has 4 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 123 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Bumpy Road Ahead

Refresh 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 173 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Bumpy Road Ahead

HandleNavigation 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 215 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ New issue: Deep, Nested Complexity

HandleNavigationForSingleMedia has a nested complexity depth of 5, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.

Check notice on line 38 in src/Umbraco.Core/Cache/Refreshers/Implement/MediaCacheRefresher.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

ℹ Getting worse: Constructor Over-Injection

MediaCacheRefresher increases from 6 to 9 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.

Check notice on line 1117 in src/Umbraco.Core/Services/MediaService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)

✅ No longer an issue: Bumpy Road Ahead

PerformMoveLocked is no longer above the threshold for logical blocks with deeply nested code