Skip to content

Commit

Permalink
Modify rules S2259;S2583;S2589;S3518;S3655;S3959 Remove replacement r…
Browse files Browse the repository at this point in the history
…ules and update description for deprecated SE rules (#4207)
  • Loading branch information
johann-beleites-sonarsource authored Aug 29, 2024
1 parent 4e78255 commit d4d145e
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 39 deletions.
7 changes: 1 addition & 6 deletions rules/S2259/java/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,5 @@
476
]
},
"defaultQualityProfiles": [],
"extra": {
"replacementRules": [
"RSPEC-6555"
]
}
"defaultQualityProfiles": []
}
4 changes: 4 additions & 0 deletions rules/S2259/java/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine.
The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._

== Why is this an issue?

A reference to `null` should never be dereferenced/accessed.
Expand Down
7 changes: 1 addition & 6 deletions rules/S2583/java/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,5 @@
570
]
},
"defaultQualityProfiles": [],
"extra": {
"replacementRules": [
"RSPEC-6651"
]
}
"defaultQualityProfiles": []
}
4 changes: 4 additions & 0 deletions rules/S2583/java/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine.
The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._

== Why is this an issue?

include::../description.adoc[]
Expand Down
7 changes: 1 addition & 6 deletions rules/S2589/java/metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"status": "deprecated",
"tags": [],
"defaultQualityProfiles": [],
"extra": {
"replacementRules": [
"RSPEC-6646"
]
}
"defaultQualityProfiles": []
}
4 changes: 4 additions & 0 deletions rules/S2589/java/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine.
The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._

include::../description-common.adoc[]

=== Code examples
Expand Down
7 changes: 1 addition & 6 deletions rules/S3518/java/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,5 @@
"V-222612"
]
},
"defaultQualityProfiles": [],
"extra": {
"replacementRules": [
"RSPEC-6649"
]
}
"defaultQualityProfiles": []
}
4 changes: 4 additions & 0 deletions rules/S3518/java/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine.
The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._


If the denominator to an integer division or remainder operation is zero, a
`ArithmeticException` is thrown.

Expand Down
7 changes: 1 addition & 6 deletions rules/S3655/java/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
"title": "Optional value should only be accessed after calling isPresent()",
"status": "deprecated",
"tags": [],
"defaultQualityProfiles": [],
"extra": {
"replacementRules": [
"RSPEC-6707"
]
}
"defaultQualityProfiles": []
}
6 changes: 5 additions & 1 deletion rules/S3655/java/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine.
The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._

== Why is this an issue?

``++Optional++`` value can hold either a value or not. The value held in the ``++Optional++`` can be accessed using the ``++get()++`` method, but it will throw a
``++Optional++`` value can hold either a value or not. The value held in the ``++Optional++`` can be accessed using the ``++get()++`` method, but it will throw a

``++NoSuchElementException++`` if there is no value present. To avoid the exception, calling the ``++isPresent()++`` or ``++! isEmpty()++`` method should always be done before any call to ``++get()++``.

Expand Down
8 changes: 0 additions & 8 deletions rules/S3959/java/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
"constantCost": "10min"
},
"tags": [],
"extra": {
"replacementRules": [
"RSPEC-6976"
],
"legacyKeys": [

]
},
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-3959",
"sqKey": "S3959",
Expand Down
4 changes: 4 additions & 0 deletions rules/S3959/java/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine.
The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._

== Why is this an issue?

Stream operations are divided into intermediate and terminal operations, and are combined to form stream pipelines. After the terminal operation is performed, the stream pipeline is considered consumed, and cannot be used again. Such a reuse will yield unexpected results.
Expand Down

0 comments on commit d4d145e

Please sign in to comment.