Skip to content

Fix code scanning alert no. 45: Implicit narrowing conversion in compound assignment#1768

Merged
robfrank merged 1 commit intomainfrom
alert-autofix-45
Oct 19, 2024
Merged

Fix code scanning alert no. 45: Implicit narrowing conversion in compound assignment#1768
robfrank merged 1 commit intomainfrom
alert-autofix-45

Conversation

@robfrank
Copy link
Copy Markdown
Collaborator

Fixes https://github.com/ArcadeData/arcadedb/security/code-scanning/45

To fix the problem, we need to ensure that the type of the left-hand side of the compound assignment statement is at least as wide as the type of the right-hand side. In this case, we should change the type of the edges variable from int to long. This will prevent any implicit narrowing conversion and ensure that the edges variable can hold the value returned by countEdges without any data loss.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ound assignment

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@robfrank robfrank marked this pull request as ready for review October 19, 2024 15:12
@robfrank robfrank self-assigned this Oct 19, 2024
@robfrank robfrank added the fixed label Oct 19, 2024
@robfrank robfrank added this to the 24.11.1 milestone Oct 19, 2024
@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (29a0bff) 65144 0 0.00%
Head commit (ac27d57) 65144 (+0) 0 (+0) 0.00% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1768) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@robfrank robfrank merged commit f937a09 into main Oct 19, 2024
@robfrank robfrank deleted the alert-autofix-45 branch October 19, 2024 15:29
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