Skip to content

Factor out the network layer, and give it a window - #2066

Open
nicolasnoble wants to merge 13 commits into
grumpycoders:mainfrom
nicolasnoble:network-refactor
Open

Factor out the network layer, and give it a window#2066
nicolasnoble wants to merge 13 commits into
grumpycoders:mainfrom
nicolasnoble:network-refactor

Link the Windows system libraries into the support test project.

80c8fb5
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Code Health Review (main) failed Jul 29, 2026 in 40s

CodeScene PR Check

Quality Gate Failed

Code Health Improved (2 files improve in Code Health)

Gates Failed
New code is healthy (1 new file with code health below 9.00)
Enforce critical code health rules (1 file with Bumpy Road Ahead, Deep, Nested Complexity)
Enforce advisory code health rules (3 files with Complex Conditional, Complex Method)

Gates Passed
1 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
New code is healthy Violations Code Health Impact
network.cc 4 rules 7.98 Suppress
Enforce critical code health rules Violations Code Health Impact
network.cc 2 critical rules 7.98 Suppress
Enforce advisory code health rules Violations Code Health Impact
network.cc 2 advisory rules 7.98 Suppress
gdb-server.cc 1 advisory rule no change Suppress
web-server.cc 1 advisory rule 4.15 → 4.26 Suppress
View Improvements
File Code Health Impact Categories Improved
gui.cc 1.96 → 2.05 Lines of Code in a Single File, Complex Method, Bumpy Road Ahead, Overall Code Complexity, Deep, Nested Complexity
web-server.cc 4.15 → 4.26 Lines of Code in a Single File, Complex Conditional

Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Details

🚩 Declining Code Health (highest to lowest):

  • Bumpy Road Ahead network.cc: PCSX::Widgets::Network::draw
  • Deep, Nested Complexity network.cc: PCSX::Widgets::Network::draw
  • Complex Method network.cc: PCSX::Widgets::Network::draw
  • Complex Conditional network.cc: PCSX::Widgets::Network::drawEndpointHeader
  • Complex Method network.cc: PCSX::Widgets::Network::drawEndpointHeader
  • Complex Conditional gdb-server.cc: PCSX::GdbClient::onReadable
  • Complex Conditional web-server.cc: onReadable

✅ Improving Code Health:

  • Overall Code Complexity gdb-server.cc
  • Lines of Code in a Single File gui.cc 🔥
  • Overall Code Complexity gui.cc 🔥
  • Overall Code Complexity uvfile.cc
  • Complex Method gui.cc: PCSX::GUI::configure 🔥
  • Deep, Nested Complexity gui.cc: PCSX::GUI::configure 🔥
  • Bumpy Road Ahead gui.cc: PCSX::GUI::configure 🔥
  • Complex Conditional web-server.cc: writeCB
  • Primitive Obsession gdb-server.cc
  • Lines of Code in a Single File web-server.cc

Annotations

Check notice on line 1 in src/support/uvfile.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 4.43 to 4.35, 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 98 in src/core/gdb-server.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

❌ New issue: Complex Conditional

PCSX::GdbClient::onReadable has 1 complex conditionals with 2 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/core/gdb-server.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 8.20 to 8.18, 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/core/gdb-server.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ No longer an issue: Primitive Obsession

The ratio of primivite types in function arguments is no longer above the threshold

Check notice on line 1 in src/gui/gui.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ Getting better: Lines of Code in a Single File

The lines of code decreases from 2510 to 2389, 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 2231 in src/gui/gui.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ Getting better: Complex Method

PCSX::GUI::configure decreases in cyclomatic complexity from 49 to 28, 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 2231 in src/gui/gui.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ Getting better: Bumpy Road Ahead

PCSX::GUI::configure decreases from 12 to 6 logical blocks with deeply nested code, threshold is 2 blocks
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/gui/gui.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 11.30 to 10.90, 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 2231 in src/gui/gui.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ No longer an issue: Deep, Nested Complexity

PCSX::GUI::configure is no longer above the threshold for nested complexity depth

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 1 in src/core/web-server.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ No longer an issue: Lines of Code in a Single File

The lines of code in this module is no longer above the threshold

Check notice on line 835 in src/core/web-server.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

✅ No longer an issue: Complex Conditional

writeCB 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 warning on line 1071 in src/core/web-server.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

❌ New issue: Complex Conditional

onReadable has 2 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 warning on line 232 in src/gui/widgets/network.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

❌ New issue: Complex Method

PCSX::Widgets::Network::draw has a cyclomatic complexity of 22, 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 94 in src/gui/widgets/network.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

❌ New issue: Complex Method

PCSX::Widgets::Network::drawEndpointHeader 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 88 in src/gui/widgets/network.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

❌ New issue: Complex Conditional

PCSX::Widgets::Network::drawEndpointHeader has 1 complex conditionals with 2 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 warning on line 232 in src/gui/widgets/network.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

❌ New issue: Bumpy Road Ahead

PCSX::Widgets::Network::draw has 6 blocks with nested conditional logic. Any nesting of 2 or deeper is
considered. Threshold is 2 blocks 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 232 in src/gui/widgets/network.cc

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (main)

❌ New issue: Deep, Nested Complexity

PCSX::Widgets::Network::draw has a nested complexity depth of 4, threshold = 4

This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting,
the lower the code health.