Skip to content

Agent degrade multiple files - #99

Open
adamtornhill wants to merge 5 commits into
masterfrom
agent-degrade-multiple-files
Open

Agent degrade multiple files#99
adamtornhill wants to merge 5 commits into
masterfrom
agent-degrade-multiple-files

Conversation

@adamtornhill

Copy link
Copy Markdown
Contributor

Introducing code smells in an already bad file. Degrading a previous 10.0.

codescene-staging[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@codescene-delta-analysis

Copy link
Copy Markdown

/cs-agent skill:fix-code-health-degradations

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

CodeScene Refactoring Agent

✅ Completed

Summary

Fixed all newly introduced Code Health degradations across 2 files.

python-example.py: score improved from 6.03 to 8.03
csharp-example.cs: score improved from 8.81 to 9.38

Changes

  • Analyze change set — 2 files degraded: python-example.py (duplication, complex conditional, overall complexity) and csharp-example.cs (complex conditional, deep nesting)
  • Fix python-example.py — extracted _build_transaction_from_cart to eliminate 3-way duplication; extracted _validate_purchase_activation_options to simplify complex conditional
  • Fix csharp-example.cs — extracted ProcessNonFlagToken to reduce nesting depth; extracted ShouldApplyForceBonus, HasCriticalScoreOutOfBounds, ApplyModeFloor to remove complex conditionals
  • Verify improvements — analyze_change_set: quality_gates passed; pre_commit_safeguard: passed

Commits

1a55aca - refactor: fix code health degradations in python-example.py and csharp-example.cs


Finished at 2026-05-27 07:45:14 UTC

…p-example.cs

- python-example.py: extract _build_transaction_from_cart helper to eliminate
  duplication across create_transaction_from_cart* functions
- python-example.py: extract _validate_purchase_activation_options to simplify
  complex conditional in initialize_purchase_transaction
- csharp-example.cs: extract ProcessNonFlagToken to reduce nesting depth in
  CalculateExecutionScore
- csharp-example.cs: extract ShouldApplyForceBonus, HasCriticalScoreOutOfBounds,
  ApplyModeFloor helpers to simplify complex conditionals
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-staging[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@codescene-delta-analysis

Copy link
Copy Markdown

/cs-agent skill:fix-code-health-degradations

codescene-staging[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

CodeScene Refactoring Agent

✅ Completed

Summary

Fixed all Code Health degradations introduced in this PR:

  • python-example.py: improved from 4.86 to 5.17 (degradations removed)
  • csharp-example.cs: maintained 9.38 score (all introduced degradations fixed)

Changes

  • Analyze change set — 2 degradations: python-example.py (Complex Method cc=10,9) and csharp-example.cs (Complex Method cc=28, Bumpy Road, Primitive Obsession)
  • Review flagged files — identified specific functions needing refactoring
  • Apply fixes — extracted helper functions; introduced ScoreContext struct in C#
  • Verify improvements — quality_gates: passed

Commits

363b9c4 - refactor: fix Code Health degradations in python-example.py and csharp-example.cs


Finished at 2026-05-27 08:02:21 UTC

…p-example.cs

- python-example.py: extract _build_transaction_item and _accumulate_vat helpers
  to reduce _build_transaction_from_cart cyclomatic complexity (cc 9 -> <9),
  and split _validate_purchase_activation_options boolean logic into
  dedicated helpers to reduce cc from 10 to <9
- csharp-example.cs: introduce ScoreContext struct to encapsulate score state,
  extract ProcessArgs, ApplyFlagToken, ApplyRetryLoop, ApplyRetryIteration,
  ApplyFinalAdjustments helpers to reduce CalculateExecutionScore cc from 28,
  and eliminate Bumpy Road Ahead / Primitive Obsession degradations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants