Skip to content

Commit 897a0d6

Browse files
authored
remove -ID from sonar codemod n (#704)
ames
1 parent c5b471c commit 897a0d6

File tree

42 files changed

+63
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+63
-71
lines changed

src/codemodder/scripts/generate_docs.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -290,33 +290,31 @@ class DocMetadata:
290290
}
291291

292292
SONAR_CODEMOD_NAMES = [
293-
"numpy-nan-equality-S6725",
294-
"literal-or-new-object-identity-S5796",
295-
"django-receiver-on-top-S6552",
296-
"exception-without-raise-S3984",
297-
"fix-assert-tuple-S5905",
298-
"remove-assertion-in-pytest-raises-S5915",
299-
"flask-json-response-type-S5131",
300-
"django-json-response-type-S5131",
301-
"jwt-decode-verify-S5659",
302-
"fix-missing-self-or-cls-S5719",
303-
"secure-tempfile-S5445",
304-
"secure-random-S2245",
305-
"enable-jinja2-autoescape-S5247",
306-
"url-sandbox-S5144",
307-
"fix-float-equality-S1244",
308-
"fix-math-isclose-S6727",
309-
"sql-parameterization-S3649",
310-
"django-model-without-dunder-str-S6554",
311-
"break-or-continue-out-of-loop-S1716",
312-
"disable-graphql-introspection-S6786",
293+
"numpy-nan-equality",
294+
"literal-or-new-object-identity",
295+
"django-receiver-on-top",
296+
"exception-without-raise",
297+
"fix-assert-tuple",
298+
"remove-assertion-in-pytest-raises",
299+
"flask-json-response-type",
300+
"django-json-response-type",
301+
"jwt-decode-verify",
302+
"fix-missing-self-or-cls",
303+
"secure-tempfile",
304+
"secure-random",
305+
"enable-jinja2-autoescape",
306+
"url-sandbox",
307+
"fix-float-equality",
308+
"fix-math-isclose",
309+
"sql-parameterization",
310+
"django-model-without-dunder-str",
311+
"break-or-continue-out-of-loop",
312+
"disable-graphql-introspection",
313313
]
314314
SONAR_CODEMODS = {
315315
name: DocMetadata(
316-
importance=CORE_CODEMODS[
317-
core_codemod_name := "-".join(name.split("-")[:-1])
318-
].importance,
319-
guidance_explained=CORE_CODEMODS[core_codemod_name].guidance_explained,
316+
importance=CORE_CODEMODS[name].importance,
317+
guidance_explained=CORE_CODEMODS[name].guidance_explained,
320318
need_sarif="Yes (Sonar)",
321319
)
322320
for name in SONAR_CODEMOD_NAMES

src/core_codemods/sonar/sonar_break_or_continue_out_of_loop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarBreakOrContinueOutOfLoop = SonarCodemod.from_core_codemod(
5-
name="break-or-continue-out-of-loop-S1716",
5+
name="break-or-continue-out-of-loop",
66
other=BreakOrContinueOutOfLoop,
77
rule_id="python:S1716",
88
rule_name='"break" and "continue" should not be used outside a loop',

src/core_codemods/sonar/sonar_disable_graphql_introspection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarDisableGraphQLIntrospection = SonarCodemod.from_core_codemod(
5-
name="disable-graphql-introspection-S6786",
5+
name="disable-graphql-introspection",
66
other=DisableGraphQLIntrospection,
77
rule_id="python:S6786",
88
rule_name="GraphQL introspection should be disabled in production",

src/core_codemods/sonar/sonar_django_json_response_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarDjangoJsonResponseType = SonarCodemod.from_core_codemod(
5-
name="django-json-response-type-S5131",
5+
name="django-json-response-type",
66
other=DjangoJsonResponseType,
77
rule_id="pythonsecurity:S5131",
88
rule_name="Endpoints should not be vulnerable to reflected XSS attacks (Django)",

src/core_codemods/sonar/sonar_django_model_without_dunder_str.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarDjangoModelWithoutDunderStr = SonarCodemod.from_core_codemod(
5-
name="django-model-without-dunder-str-S6554",
5+
name="django-model-without-dunder-str",
66
other=DjangoModelWithoutDunderStr,
77
rule_id="python:S6554",
88
rule_name='Django models should define a "__str__" method',

src/core_codemods/sonar/sonar_django_receiver_on_top.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarDjangoReceiverOnTop = SonarCodemod.from_core_codemod(
5-
name="django-receiver-on-top-S6552",
5+
name="django-receiver-on-top",
66
other=DjangoReceiverOnTop,
77
rule_id="python:S6552",
88
rule_name="Django signal handler functions should have the `@receiver` decorator on top of all other decorators",

src/core_codemods/sonar/sonar_enable_jinja2_autoescape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarEnableJinja2Autoescape = SonarCodemod.from_core_codemod(
5-
name="enable-jinja2-autoescape-S5247",
5+
name="enable-jinja2-autoescape",
66
other=EnableJinja2Autoescape,
77
rule_id="python:S5247",
88
rule_name="Disabling auto-escaping in template engines is security-sensitive",

src/core_codemods/sonar/sonar_exception_without_raise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarExceptionWithoutRaise = SonarCodemod.from_core_codemod(
5-
name="exception-without-raise-S3984",
5+
name="exception-without-raise",
66
other=ExceptionWithoutRaise,
77
rule_id="python:S3984",
88
rule_name="Exceptions should not be created without being raised",

src/core_codemods/sonar/sonar_fix_assert_tuple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarFixAssertTuple = SonarCodemod.from_core_codemod(
5-
name="fix-assert-tuple-S5905",
5+
name="fix-assert-tuple",
66
other=FixAssertTuple,
77
rule_id="python:S5905",
88
rule_name="Assert should not be called on a tuple literal",

src/core_codemods/sonar/sonar_fix_float_equality.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from core_codemods.sonar.api import SonarCodemod
33

44
SonarFixFloatEquality = SonarCodemod.from_core_codemod(
5-
name="fix-float-equality-S1244",
5+
name="fix-float-equality",
66
other=FixFloatEquality,
77
rule_id="python:S1244",
88
rule_name="Floating point numbers should not be tested for equality",

0 commit comments

Comments
 (0)