Skip to content

feat: Improve inbox and outbox#3659

Merged
lillo42 merged 6 commits into
BrighterCommand:masterfrom
lillo42:improve-inbox-outbox
Jul 25, 2025
Merged

feat: Improve inbox and outbox#3659
lillo42 merged 6 commits into
BrighterCommand:masterfrom
lillo42:improve-inbox-outbox

Conversation

@lillo42

@lillo42 lillo42 commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

During my implementation of GCP Spanner, I saw that Inbox and Outbox pattern have a lot code duplicated between provider, in this PR I'm moving the duplicated code to the base class (allowing those method to be override if necessary) and fix URI issue

Fix: #3653

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Improved (9 files improve in Code Health)

Gates Failed
Prevent hotspot decline (1 hotspot with Lines of Code in a Single File, Number of Functions in a Single Module)
Enforce advisory code health rules (2 files with Lines of Code in a Single File, Number of Functions in a Single Module, Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
RelationDatabaseOutbox.cs 2 rules in this hotspot 6.90 → 7.11 Suppress
Enforce advisory code health rules Violations Code Health Impact
RelationalDatabaseInbox.cs 1 advisory rule 8.55 → 8.03 Suppress
RelationDatabaseOutbox.cs 2 advisory rules 6.90 → 7.11 Suppress
View Improvements
File Code Health Impact Categories Improved
MsSqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
MySqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
PostgreSqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
SqliteInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
MsSqlOutbox.cs 6.81 → 10.00 Low Cohesion, Code Duplication, Complex Method
MySqlOutbox.cs 9.39 → 10.00 Code Duplication
PostgreSqlOutbox.cs 7.74 → 10.00 Low Cohesion, Code Duplication, Large Method
SqliteOutbox.cs 7.80 → 10.00 Low Cohesion, Code Duplication, Large Method
RelationDatabaseOutbox.cs 6.90 → 7.11 Low Cohesion
RelationalDatabaseInbox.cs 8.55 → 8.03 Primitive Obsession

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.IO;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Lines of Code in a Single File
This module has 1285 lines of code, improve code health by reducing it to 1000

Suppress

using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.IO;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Number of Functions in a Single Module
This module has 78 functions, threshold = 75

Suppress

using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text.Json;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Getting worse: Code Duplication
introduced similar code in: MapBoolFunction,MapBoolFunctionAsync,MapBoolFunctionAsync

Suppress

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Improved (9 files improve in Code Health)

Gates Failed
Prevent hotspot decline (1 hotspot with Lines of Code in a Single File, Number of Functions in a Single Module)
Enforce advisory code health rules (2 files with Lines of Code in a Single File, Number of Functions in a Single Module, Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
RelationDatabaseOutbox.cs 2 rules in this hotspot 6.90 → 7.11 Suppress
Enforce advisory code health rules Violations Code Health Impact
RelationalDatabaseInbox.cs 1 advisory rule 8.55 → 8.03 Suppress
RelationDatabaseOutbox.cs 2 advisory rules 6.90 → 7.11 Suppress
View Improvements
File Code Health Impact Categories Improved
MsSqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
MySqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
PostgreSqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
SqliteInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
MsSqlOutbox.cs 6.81 → 10.00 Low Cohesion, Code Duplication, Complex Method
MySqlOutbox.cs 9.39 → 10.00 Code Duplication
PostgreSqlOutbox.cs 7.74 → 10.00 Low Cohesion, Code Duplication, Large Method
SqliteOutbox.cs 7.80 → 10.00 Low Cohesion, Code Duplication, Large Method
RelationDatabaseOutbox.cs 6.90 → 7.11 Low Cohesion
RelationalDatabaseInbox.cs 8.55 → 8.03 Primitive Obsession

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

# Conflicts:
#	src/Paramore.Brighter.Inbox.MsSql/MsSqlInbox.cs
#	src/Paramore.Brighter.Inbox.MySql/MySqlInbox.cs
#	src/Paramore.Brighter.Inbox.Postgres/Paramore.Brighter.Inbox.Postgres.csproj
#	src/Paramore.Brighter.Inbox.Postgres/PostgreSqlInbox.cs
#	src/Paramore.Brighter.Inbox.Sqlite/SqliteInbox.cs
#	src/Paramore.Brighter.Outbox.MySql/MySqlOutbox.cs
@lillo42 lillo42 marked this pull request as ready for review July 21, 2025 08:20
@lillo42 lillo42 added 3 - Done .NET Pull requests that update .net code and removed 2 - In Progress labels Jul 21, 2025
@lillo42 lillo42 mentioned this pull request Jul 21, 2025
4 tasks

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Improved (9 files improve in Code Health)

Gates Failed
Prevent hotspot decline (1 hotspot with Lines of Code in a Single File, Number of Functions in a Single Module)
Enforce advisory code health rules (2 files with Lines of Code in a Single File, Number of Functions in a Single Module, Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
RelationDatabaseOutbox.cs 2 rules in this hotspot 6.90 → 7.11 Suppress
Enforce advisory code health rules Violations Code Health Impact
RelationalDatabaseInbox.cs 1 advisory rule 8.55 → 8.03 Suppress
RelationDatabaseOutbox.cs 2 advisory rules 6.90 → 7.11 Suppress
View Improvements
File Code Health Impact Categories Improved
MsSqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
MySqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
PostgreSqlInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
SqliteInbox.cs 9.10 → 10.00 Code Duplication, Primitive Obsession
MsSqlOutbox.cs 6.81 → 10.00 Low Cohesion, Code Duplication, Complex Method
MySqlOutbox.cs 9.39 → 10.00 Code Duplication
PostgreSqlOutbox.cs 7.74 → 10.00 Low Cohesion, Code Duplication, Large Method
SqliteOutbox.cs 7.80 → 10.00 Low Cohesion, Code Duplication, Large Method
RelationDatabaseOutbox.cs 6.90 → 7.11 Low Cohesion
RelationalDatabaseInbox.cs 8.55 → 8.03 Primitive Obsession

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

@lillo42 lillo42 merged commit 6a14903 into BrighterCommand:master Jul 25, 2025
22 of 24 checks passed
@lillo42 lillo42 deleted the improve-inbox-outbox branch July 25, 2025 18:48
DevJonny pushed a commit to DevJonny/Brighter that referenced this pull request Feb 28, 2026
* feat: Improve inbox and outbox

* fix: MySQL tests

* fix: MSSQL unit test

---------

Co-authored-by: Ian Cooper <ian_hammond_cooper@yahoo.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Done Breaking Change .NET Pull requests that update .net code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] V10 Outbox Source & DataSchema are force to be Absolute

2 participants