Skip to content

Fix in LastStatementId#13

Open
byjg wants to merge 8 commits intomasterfrom
5.0
Open

Fix in LastStatementId#13
byjg wants to merge 8 commits intomasterfrom
5.0

Conversation

@byjg
Copy link
Copy Markdown
Owner

@byjg byjg commented Nov 7, 2025

No description provided.

@korbit-ai
Copy link
Copy Markdown

korbit-ai Bot commented Nov 7, 2025

I was unable to write a description for this pull request. This could be because I only found files I can't scan.

Copy link
Copy Markdown

@korbit-ai korbit-ai Bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Readability Imprecise constraint naming ▹ view
Functionality Misleading constraint name for non-negative check ▹ view
Functionality Misleading constraint name for non-negative check ▹ view
Files scanned
File Path Reviewed
db/migrations/down/00002-delete-laststatementid.sql
db/migrations/up/00003-add-laststatementid.sql
db/migrations/down/00003-delete-constraint.sql
db/migrations/up/00004-add-constraint.sql
src/Bll/AccountTypeBLL.php
src/Repository/BaseRepository.php
src/Entity/AccountEntity.php
src/DTO/StatementDTO.php
src/Bll/AccountBLL.php
src/Bll/StatementBLL.php

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@@ -0,0 +1,8 @@
ALTER TABLE statement
ADD CONSTRAINT statement_chk_value_nonnegative
CHECK (netbalance >= 0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Imprecise constraint naming category Readability

Tell me more
What is the issue?

The constraint name suggests 'nonnegative' but the logic checks for 'greater than or equal to zero', which could be more explicitly stated in the constraint name.

Why this matters

When other developers encounter this code, they need to check the actual constraint logic to confirm what 'nonnegative' means. A more precise name would make the behavior immediately clear.

Suggested change ∙ Feature Preview
ALTER TABLE statement
    ADD CONSTRAINT statement_chk_netbalance_gte_zero
        CHECK (netbalance >= 0);

ALTER TABLE account
    ADD CONSTRAINT account_chk_netbalance_gte_zero
        CHECK (netbalance >= 0);
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

Comment on lines +2 to +3
ADD CONSTRAINT statement_chk_value_nonnegative
CHECK (netbalance >= 0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Misleading constraint name for non-negative check category Functionality

Tell me more
What is the issue?

The constraint name 'statement_chk_value_nonnegative' suggests it's checking for non-negative values, but the CHECK condition allows zero values (>= 0) rather than strictly positive values (> 0).

Why this matters

This naming inconsistency could mislead future developers about the actual constraint behavior, potentially causing incorrect assumptions when writing application logic or additional constraints.

Suggested change ∙ Feature Preview

Either rename the constraint to reflect that zero is allowed (e.g., 'statement_chk_netbalance_not_negative') or change the condition to CHECK (netbalance > 0) if truly non-negative values are required:

ALTER TABLE statement
    ADD CONSTRAINT statement_chk_netbalance_not_negative
        CHECK (netbalance >= 0);
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

Comment on lines +6 to +7
ADD CONSTRAINT account_chk_value_nonnegative
CHECK (netbalance >= 0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Misleading constraint name for non-negative check category Functionality

Tell me more
What is the issue?

The constraint name 'account_chk_value_nonnegative' suggests it's checking for non-negative values, but the CHECK condition allows zero values (>= 0) rather than strictly positive values (> 0).

Why this matters

This naming inconsistency could mislead future developers about the actual constraint behavior, potentially causing incorrect assumptions when writing application logic or additional constraints.

Suggested change ∙ Feature Preview

Either rename the constraint to reflect that zero is allowed (e.g., 'account_chk_netbalance_not_negative') or change the condition to CHECK (netbalance > 0) if truly non-negative values are required:

ALTER TABLE account
    ADD CONSTRAINT account_chk_netbalance_not_negative
        CHECK (netbalance >= 0);
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

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.

1 participant