60 Commits

Author SHA1 Message Date
Egon Okerman
d1417e82f8
Modify CWE and OWASP Top 10 links to follow standard link format (APPSEC-1134) (#3529)
* Fix all CWE references

* Fix all OWASP references

* Fix missing CWE prefixes
2024-01-15 17:15:56 +01:00
Marco Borgeaud
072e67b8d4
Fix asciidoc w.r.t. C++ (#3519)
"C++" spelled as-is can result in unexpected rendering, such as

    C++20 was released before C++17

renders as

    C20 was released before C17

Make consistent use of `[source,cpp]`.
2023-12-21 15:51:41 +01:00
Fred Tingaud
22b4470f2a
Modify CFamily rules: CPP-4080 Refresh and standardize CppCoreGuidelines references (#3514)
Update all links to C++ Core Guidelines to `e49158a`.

Refresh done using the following script and some manual edits:
db76e34e74/personal/fred-tingaud/rspec/refresh-cppcoreguidelines.py

When re-using this script, be mindful that:
 - it does not cover `shared_content`
 - it does not properly escape inline code in links (e.g., "[=]" or "`mutex`es")
 - it does not change `C++` to `{cpp}` in link titles.

Co-authored-by: Marco Borgeaud <marco.borgeaud@sonarsource.com>
2023-12-20 10:08:18 +01:00
Yassin Kammoun
ffa9fc6bb2
Tag RSPECs of JS/TS rules relying on type information (#3354)
## Review

A dedicated reviewer checked the rule description successfully for:

- [ ] logical errors and incorrect information
- [ ] information gaps and missing content
- [ ] text style and tone
- [ ] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
2023-10-24 09:17:27 +00:00
Rudy Regazzoni
9aca4314df
Modify S2259: Migrate to LaYC - null dereference (#3337)
## Review

A dedicated reviewer checked the rule description successfully for:

- [ ] logical errors and incorrect information
- [ ] information gaps and missing content
- [ ] text style and tone
- [ ] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)

---------

Co-authored-by: Loris S <91723853+loris-s-sonarsource@users.noreply.github.com>
Co-authored-by: leonardo-pilastri-sonarsource <115481625+leonardo-pilastri-sonarsource@users.noreply.github.com>
2023-10-23 12:29:59 +00:00
Yassin Kammoun
531e4225da
Migrate links from JavaScript RSPECs to the LaYC format (#3309) 2023-10-19 11:46:59 +02:00
Marco Borgeaud
76791bbfe8
Remove link to CERT Java from CFamily (#3296)
Remove irrelevant links from C/C++ descriptions. No effort was made to
replace them when there wasn't already a link to CERT C. This will be
done as part of a separate effort, one day.
2023-10-18 10:49:02 +00:00
Marco Borgeaud
cd424756a0
Validate asciidoc ifdef/endif (#3311)
Fix kotlin:S6511
2023-10-18 09:43:40 +00:00
Philipp Dominik Schubert
f45132d5aa
Modify rule S2637: Expand and adjust for LaYC
## Review

A dedicated reviewer checked the rule description successfully for:

- [x] logical errors and incorrect information
- [x] information gaps and missing content
- [x] text style and tone
- [x] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)

---------

Co-authored-by: Arseniy Zaostrovnykh <arseniy.zaostrovnykh@sonarsource.com>
2023-10-04 13:02:47 +02:00
Anton Haubner
3bfd5bcb3c
Modify rule S2259: Extend LaYC content for Python (#3178) 2023-09-29 13:44:06 +02:00
tomasz-kaminski-sonarsource
be4265a91f
Modify rule S2259: Expand and adjust for LaYC 2023-08-24 09:32:24 +02:00
Amélie Renard
4698df5e2e
CPP-3691 Remove "MISRA C++ 2008 recommended" and "MISRA C++ 2008" quality profiles from all RSPECs 2023-08-10 17:32:11 +02:00
Antonio Aversa
a02bf814d4
Clean Code Taxonomy: add "code" to all non-obsolete metadata.json (#2793) 2023-08-04 17:19:38 +02:00
Victor
33e029d4f1
Modify rule S2259: Adapt to LaYC (#2672) 2023-07-26 16:00:44 +02:00
Sebastien Marichal
29ad149df9
Modify rule S2259: Remove anchor link (#2415) 2023-07-06 11:15:14 +02:00
Sebastien Marichal
fa669b3c8e
Modify rule S2259: LaYC format (#2294) 2023-07-03 17:26:15 +02:00
Fred Tingaud
51369b610e
Make sure that includes are always surrounded by empty lines (#2270)
When an include is not surrounded by empty lines, its content is inlined
on the same line as the adjacent content. That can lead to broken tags
and other display issues.
This PR fixes all such includes and introduces a validation step that
forbids introducing the same problem again.
2023-06-22 10:38:01 +02:00
Fred Tingaud
2cf7d97fd2
Remove languages that were never implemented for shared rules
Rules that were never implemented for any language are also removed.

Removing, per language:

## cobol
[S103, S1068, S1075, S1125, S1139, S1151, S126, S1301, S1488, S1607,
S1614, S1615, S1639, S1751, S1763, S1820, S1821, S1909, S1940, S1968,
S2024, S2145, S2189, S2190, S2197, S2251, S2252, S2760, S3047, S3269,
S3516, S3635, S3638, S3639, S3645, S3650, S3651, S3776, S3830, S3931,
S4109, S4143, S4158, S4165, S4632, S4663, S5871, S6194, S6273]

## csharp
[S1034, S1103, S1105, S1106, S1107, S1108, S1126, S1131, S1142, S115,
S1166, S117, S119, S1223, S124, S1247, S1312, S1314, S139, S140, S1448,
S1578, S1695, S1707, S1820, S1872, S1874, S1941, S1968, S1987, S2095,
S2107, S2108, S2139, S2145, S2147, S2149, S2159, S2177, S2189, S2205,
S2250, S2301, S2334, S2373, S2490, S2544, S2588, S2596, S2597, S2690,
S2691, S2702, S2752, S2833, S3041, S3044, S3047, S3062, S3065, S3075,
S3076, S3087, S3222, S3239, S3269, S3317, S3325, S3359, S3375, S3414,
S3473, S3516, S3518, S4030, S4165, S4470, S4632, S4977, S5359, S5871,
S6061, S6147, S6194, S864, S867, S899, S997]

## flex
[S1034, S104, S105, S1067, S1075, S109, S1103, S1104, S1105, S1106,
S1107, S1108, S1109, S1110, S1119, S1121, S1126, S113, S1131, S1141,
S1143, S1168, S1192, S1200, S121, S1226, S1247, S126, S1264, S1291,
S139, S1450, S1479, S1488, S1546, S1607, S1656, S1659, S1751, S1763,
S1764, S1782, S1845, S1854, S1858, S1862, S1872, S1905, S1940, S1941,
S1987, S1990, S1994, S2039, S2123, S2139,2145, S2149, S2156, S2159,
S2189, S2190, S2197, S2198, S2201, S2205, S2234, S2251, S2252, S2259,
S2301, S2387, S2440, S2583, S2588, S2589, S2596, S2597, S2639, S2681,
S2691, S2737, S2752, S2757, S2760, S2761, S2887, S2963, S3031, S3041,
S3047, S3065, S3075, S3076, S3222, S3239, S3241, S3242, S3269, S3358,
S3370, S3440, S3458, S3516, S3518, S3776, S3872, S3981, S4025, S4143,
S4144, S4158, S4165, S4632, S4663, S5871, S6194, S878, S881, S899]

## java
[S1034, S1131, S1247, S1453, S1707, S1772, S1782, S1888, S1968, S1990,
S2107, S2108, S2145, S2149, S2198, S2205, S2327, S2373, S2436, S2490,
S2526, S2588, S2596, S2597, S2690, S2691, S2702, S2738, S2752, S2760,
S2814, S2833, S2963, S2997, S3018, S3019, S3031, S3041, S3044, S3062,
S3075, S3076, S3087, S3222, S3239, S3241, S3249, S3263, S3269, S3317,
S3353, S3359, S3370, S3375, S3397, S3440, S3458, S3473, S3604, S3872,
S3887, S3949, S4025, S4030, S4136, S4158, S4632, S4663, S5780, S5781,
S5871, S6194, S787]

## php
[S1034, S109, S1104, S1107, S1119, S1120, S1128, S1143, S1199, S1213,
S1247, S1450, S1694, S1707, S1845, S1858, S1872, S1905, S1941, S1952,
S1968, S1987, S1994, S2095, S2108, S2114, S2139, S2145, S2149, S2156,
S2159, S2177, S2189, S2190, S2197, S2205, S2252, S2259, S2301, S2387,
S2583, S2588, S2589, S2596, S2597, S2639, S2691, S2752, S2760, S2814,
S2833, S3010, S3041, S3047, S3065, S3075, S3239, S3254, S3269, S3400,
S3440, S3458, S3466, S3516, S3518, S3872, S3931, S4030, S4165, S4188,
S4275, S4632, S4663, S5797, S5871, S6194, S864, S899]

## pli
[S104, S105, S1066, S1067, S1068, S1075, S108, S1110, S1135, S1151,
S1172, S1186, S1247, S125, S126, S1291, S1301, S138, S1451, S1479,
S1481, S1488, S1607, S1614, S1615, S1656, S1737, S1745, S1751, S1763,
S1764, S1821, S1854, S1862, S1871, S1909, S1940, S2527, S2583, S2589,
S2681, S2757, S3516, S3633, S3635, S3637, S3638, S3639, S3640, S3641,
S3643, S3644, S3645, S3647, S3650, S3651, S3652, S3776, S3890, S3923,
S3973, S4632, S4663, S5871, S6194, S864]

## abap
[S1045, S1075, S1135, S1144, S1186, S1226, S1291, S138, S1448, S1451,
S1479, S1601, S1607, S1763, S1820, S1821, S1854, S1905, S1909, S1940,
S2147, S2189, S2190, S2387, S2527, S2583, S2589, S2737, S2760, S3047,
S3269, S3358, S3516, S3635, S3637, S3638, S3639, S3640, S3641, S3644,
S3645, S3647, S3650, S3651, S3652, S4109, S4165, S4632, S4663, S5871,
S6194, S864]

## plsql
[S105, S1067, S1075, S1120, S1139, S1186, S1226, S1247, S138, S1488,
S1578, S1607, S1639, S1737, S1738, S1909, S2234, S2583, S2589, S2814,
S3269, S3270, S3358, S3516, S3518, S3635, S3637, S3638, S3639, S3640,
S3644, S3645, S3647, S3650, S3652, S3776, S3890, S3931, S3981, S4109,
S4165, S4413, S4632, S4663, S5871, S6194, S864]

## python
[S105, S1067, S1075, S109, S1125, S1126, S1128, S115, S1155, S1247,
S126, S1314, S1448, S1450, S1488, S1695, S1696, S1820, S1872, S1905,
S1941, S1952, S1987, S1996, S2095, S2114, S2139, S2145, S2149, S2166,
S2189, S2197, S2205, S2251, S2252, S2301, S2321, S2588, S2596, S2597,
S2639, S2691, S2752, S2760, S2833, S2963, S3041, S3047, S3065, S3075,
S3239, S3241, S3254, S3269, S3440, S3458, S3466, S3696, S3717, S3723,
S3872, S4030, S4158, S4165, S4632, S4663, S5871, S6194, S864, S899,
S907]

## javascript
[S1065, S1068, S1103, S1104, S1106, S1107, S1108, S1109, S1142, S1144,
S1147, S115, S1151, S116, S1199, S1200, S1247, S1291, S140, S1448,
S1450, S1578, S1607, S1659, S1707, S1820, S1845, S1872, S1905, S1941,
S1952, S1968, S1987, S1996, S2039, S2108, S2145, S2149, S2159, S2190,
S2205, S2252, S2301, S2326, S2372, S2387, S2588, S2596, S2597, S2691,
S2752, S2830, S2887, S2959, S3041, S3047, S3065, S3075, S3235, S3239,
S3325, S3440, S3458, S3518, S3872, S4025, S4487, S4632, S4663, S5603,
S5871, S6194, S864, S899]

## rpg
[S1066, S107, S1075, S1110, S1135, S1172, S1186, S124, S1247, S1291,
S1301, S131, S1448, S1479, S1481, S1578, S1607, S1614, S1615, S1735,
S1739, S1741, S1745, S1751, S1763, S1821, S1854, S1909, S1940, S1968,
S2189, S2190, S2197, S2251, S2252, S2260, S2527, S2583, S2589, S2757,
S2760, S3047, S3269, S3516, S3635, S3637, S3638, S3639, S3640, S3641,
S3643, S3644, S3645, S3647, S3650, S3651, S3652, S3776, S3890, S3923,
S4109, S4158, S4165, S4632, S4663, S5871, S6194, S864]

## rust
[S1066, S1067, S1172, S125, S1763, S2757, S2761, S3358, S3776, S3923,
S3981, S4143, S4144, S4663, S5871, S6194]

## solidity
[S1066, S1067, S125, S2757, S3776, S3923, S3981, S4143, S4144, S5871,
S6194]

## vbnet
[S1068, S1104, S1105, S1106, S1126, S1131, S1142, S1143, S1144, S116,
S119, S124, S1247, S125, S127, S140, S1448, S1488, S1578, S1607,1669,
S1694, S1695, S1696, S1698, S1707, S1763, S1820, S1845, S1854, S1858,
S1872, S1905, S1941, S1968, S1987, S2096, S2108, S2139, S2145, S2149,
S2159, S2189, S2190, S2197, S2198, S2201, S2205, S2250, S2251, S2301,
S2334, S2583, S2588, S2589, S2596, S2597, S2691, S2760, S3041, S3047,
S3236, S3239, S3242, S3269, S3376, S3440, S3458, S3516, S3518, S3626,
S3688, S3872, S3902, S3906, S3908, S3925, S3993, S3994, S3995, S3996,
S3997, S4004, S4005, S4018, S4022, S4023, S4026, S4030, S4040, S4158,
S4165, S4220, S4456, S4457, S4462, S4470, S4632, S5871, S6061, S6194,
S864, S899]

## html
[S1075, S1143, S1291, S1707, S1952, S2166, S2197, S2201, S2205, S2251,
S2588, S2596, S2597, S4632, S4663, S5871]

## tsql
[S1075, S1125, S1226, S1741, S1854, S2234, S2524, S2544, S2583, S2589,
S2757, S3270, S3618, S3651, S3776, S3830, S3981, S4158, S4165, S4632,
S4663, S5245, S5871, S6194, S864]

## vb6
[S1075, S1110, S1144, S1172, S1192, S1226, S125, S126, S127, S1291,
S134, S1448, S1451, S1481, S1578, S1607, S1656, S1707, S1751, S1763,
S1764, S1854, S1858, S1862, S1871, S1909, S1940, S1941,1987, S2145,
S2149, S2189, S2190, S2197, S2198, S2205, S2234, S2251, S2252, S2259,
S2301, S2583, S2588, S2596, S2597, S2760, S2761, S3047, S3269, S3440,
S3458, S3516, S3626, S3776, S3923, S3981, S4143, S4144, S4158, S4165,
S4632, S4663, S5871, S6145, S6146, S6194, S899]

## swift
[S109, S1103, S1119, S1121, S1185, S1226, S1247, S127, S1270, S1291,
S1448, S1450, S1537, S1545, S1578, S1607, S1707, S1874, S1968, S2039,
S2114, S2123, S2177, S2234, S2253, S2301, S2373, S2440, S2490, S2583,
S2588, S2589, S2596, S2597, S2639, S2691, S2752, S2833, S2931, S3019,
S3031, S3041, S3044, S3047, S3065, S3075, S3076, S3239, S3241, S3242,
S3244, S3254, S3269, S3317, S3353, S3366, S3370, S3397, S3398, S3440,
S3458, S3466, S3516, S3518, S3688, S3872, S3931, S3949, S4025, S4030,
S4158, S4165, S4200, S4275, S4487, S4503, S4632, S4663, S5359, S5871,
S6194, S864, S867, S925]

## cfamily
[S1104, S1105, S1106, S1107, S1108, S1109, S1124, S1125, S1126, S114,
S115, S119, S1192, S1200, S1247, S1312, S1450, S1453, S1488, S1595,
S1607, S1782, S1845, S1888, S1899, S1941, S1952, S1968, S2039, S2096,
S2108, S2139, S2149, S2159, S2164, S2166, S2177, S2198, S2205, S2252,
S2326, S2327, S2440, S2490, S2588, S2596, S2597, S2639, S2691, S2752,
S2760, S2833, S2963, S3031, S3038, S3044, S3047, S3065, S3075, S3076,
S3235, S3239, S3241, S3242, S3269, S3317, S3353, S3370, S3397, S3398,
S3440, S3466, S3872, S3878, S3981, S3984, S3985, S4025, S4158, S4165,
S4275, S4503, S4632, S4663, S4970, S5871]

## xml
[S1128, S1291, S1707, S4632, S4663]

## kotlin
[S113, S2583, S3011, S3973, S4143, S5871, S6194]

## scala
[S113, S2583, S2757, S2761, S3011, S3358, S3981, S4143, S5871, S6194]

## go
[S1155, S125, S127, S2114, S2197, S2583, S3626, S4487, S4632, S5871,
S6194, S899]

## ruby
[S125, S2583, S3973, S3981, S4143, S5871, S6194]

## apex
[S2761, S3358, S3981, S4143, S5871, S6194]

## css
[S4632, S5871]
2023-06-14 14:43:06 +02:00
Fred Tingaud
16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00
Victor
fe961619f9 migrate rule descriptions to new education format 2023-05-05 16:29:04 +02:00
leonardo-pilastri-sonarsource
8e459cca14
Modify SE engine rules to add "symbolic-execution" tag (#1832) 2023-05-05 14:46:46 +02:00
Pavel Mikula
cf50119587
Rule S2259: Add VB.NET, improve C# (#1208) 2022-09-05 08:04:25 +02:00
Guillaume Dequenne
c7a35480a8
Modify rule S2259: Update rule description for Python (#1037) 2022-06-09 12:06:39 +02:00
jtingsanchali
96d9ddb930
RULEAPI-755 Update CWE URLs by removing .html suffix and update with https protocol (#926)
* Change affects only see.adoc and rule.adoc files, not comments-and-links.adoc files
2022-04-07 08:53:59 -05:00
Fred Tingaud
b4161466e6
RULEAPI-661: Add syntax coloring 2022-02-04 16:28:24 +00:00
Pierre-Loup
2eb4c50a9b
RULEAPI-710: Validate that security-standards are not shadowed 2021-10-29 16:55:50 +00:00
Arseniy Zaostrovnykh
6a0ec99e78
RULEAPI-706: Add quick fixes metadata 2021-10-07 09:23:15 +00:00
Arseniy Zaostrovnykh
2301f5808e
RULEAPI-695: remove extra/coveredLanguages field 2021-09-28 13:36:45 +02:00
Arseniy Zaostrovnykh
ec55b6ead1
RULEAPI-687: Migrate legacy keys from Jira RSPEC (#392) 2021-09-24 09:08:46 +02:00
Arseniy Zaostrovnykh
5ba82ae371
RULEAPI-665: Remove security standards from the irrelevant language-specific rules (#362) 2021-09-21 15:40:35 +02:00
Arseniy Zaostrovnykh
f7904cebe7
RULEAPI-666: Migrate the "List of parameters", "Highlighting" and "Message" fields from jira RSPEC (#346) 2021-09-20 13:38:42 +00:00
Arseniy Zaostrovnykh
11c08de44a
Revert "RULEAPI-665: Remove security standards from the irrelevant language-specific rules" (#361)
This reverts commit 892bccde8ffcdf2a6d662d97ec469cd63de87878.
2021-09-17 13:50:03 +02:00
Arseniy Zaostrovnykh
892bccde8f
RULEAPI-665: Remove security standards from the irrelevant language-specific rules 2021-09-17 13:44:41 +02:00
Elena Vilchik
4017668a76
Fixes for JavaScript: remove 'Sonar way recommended' profile and legacy keys (#148) 2021-06-25 14:41:11 +02:00
Tibor Blenessy
7cd5e8475b
Update property used in S2259 (#130)
See https://github.com/SonarSource/SonarJS/issues/2670
2021-06-15 09:24:56 +02:00
Arseniy Zaostrovnykh
b76bc57083
RULEAPI-576: add a horizontal rule between rule description and comments 2021-06-08 15:52:13 +02:00
Arseniy Zaostrovnykh
6fc8e148c2
RULEAPI-644: Export security standards from Jira 2021-06-08 08:36:49 +02:00
Arseniy Zaostrovnykh
6c1ad2c13c Fix the comment display: rule-id, timestamp, GH visibility, link direction 2021-06-03 09:05:38 +02:00
Arseniy Zaostrovnykh
cdd7690a79 Export comments and rspec-to-rspec links from jira 2021-06-02 20:44:38 +02:00
Arseniy Zaostrovnykh
acadea59e9 move coveredLangauges and replacementRules into extra field 2021-02-16 17:52:17 +01:00
Arseniy Zaostrovnykh
1d713451d6 Undo the abuse of compatibleLanguages metadata field 2021-02-16 15:00:44 +01:00
Arseniy Zaostrovnykh
a09a26d560 fix hading of {{\+}} and sort the compatible languages 2021-02-08 12:42:26 +01:00
Arseniy Zaostrovnykh
b62862646c move typescript rules to javascript directory 2021-02-08 10:49:37 +01:00
sonartech
0ffbfb133d Nightly update 2021-02-06 04:10:49 +00:00
Arseniy Zaostrovnykh
af8cda992b unescape more things 2021-02-05 10:34:25 +01:00
Arseniy Zaostrovnykh
402a7d7be3 sort metadata fields 2021-02-04 12:27:03 +01:00
Arseniy Zaostrovnykh
f6093ee186 Overapproximate compatibleLanguages and tags/standards 2021-02-02 19:11:00 +01:00
Arseniy Zaostrovnykh
716b335a56 Enable forced linebreaks in quotes; escape -- in url 2021-02-02 16:54:43 +01:00
Arseniy Zaostrovnykh
7ca29f686f Force linebreaks 2021-02-02 15:02:10 +01:00
Arseniy Zaostrovnykh
1a22006270 Add coveredLanguages field 2021-01-29 15:53:23 +01:00