Skip to content

V3/sonarcloud replace this declaration by a structured binding declaration #3217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gberkes
Copy link
Contributor

@gberkes gberkes commented Aug 7, 2024

what

  • Refactor: replaced 3 declarations with 3 structured binding declarations
  • Refactor: flipped the conditions in "if (contains[Tag|Msg|Id]( ... " statements
    for clearer code.
  • Refactor: moved "Variable *b" as an init-statement inside "if()" statements for
    stricter scope.
  • Suppress cppcheck false positive unassignedVariable warning.

why

This syntax is far more expressive and easier to understand than the old one.

references

Sonarcloud Replace this declaration by a structured binding declaration.

gberkes added 2 commits August 7, 2024 17:55
…ons.

This syntax is far more expressive and easier to understand than the old one.

Refactor: flipped the conditions in "if (contains[Tag|Msg|Id]( ... " statements
for clearer code.

Refactor: moved "Variable *b" as an init-statement inside "if()" statements for
stricter scope.

Reference: https://sonarcloud.io/project/issues?open=AY8-ff1vm_fzkWiCOtCt&id=owasp-modsecurity_ModSecurity
Copy link

sonarqubecloud bot commented Aug 7, 2024

@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Aug 8, 2024
Copy link
Member

@airween airween left a comment

Choose a reason for hiding this comment

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

LGTM

@airween airween merged commit a519c65 into owasp-modsecurity:v3/master Aug 8, 2024
49 checks passed
@airween
Copy link
Member

airween commented Aug 8, 2024

Thank you @gberkes!

airween added a commit to airween/ModSecurity that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants