5301 Commits

Author SHA1 Message Date
Pavel Mikula
bfd616337b
Update Jira project keys for T-SQL, PL/SQL and VB6 (#4804) 2025-03-20 09:57:00 +00:00
GabinL21
cd6491db81
SONARTEXT-418 Create rules S7209 to S7402 (#4801)
* SONARTEXT-418 Create rules S7209 to S7402

* SONARTEXT-418 Create rules S7209 to S7402

* SONARTEXT-418 Add PKCE to OAuth2 secrets

* SONARTEXT-418 Fix validation
2025-03-19 20:11:43 +00:00
Antonio Aversa
1a1a60f52d
SONARKT-569 Modify rule S4830: add support for WebViews (#4673)
* SONARKT-569 Modify rule S4830: add support for WebViews

* Fix list of allowed frameworks

* Add Google Support link

* Have non-compliant and compliant code examples next to each other and in diff

* Update rules/S4830/kotlin/how-to-fix-it/android-webview.adoc

Co-authored-by: Egon Okerman <egon.okerman@sonarsource.com>

* Update rules/S4830/kotlin/how-to-fix-it/android-webview.adoc

Co-authored-by: Egon Okerman <egon.okerman@sonarsource.com>

---------

Co-authored-by: Egon Okerman <egon.okerman@sonarsource.com>
2025-03-19 15:31:02 +00:00
Antonio Aversa
d41b77b623
DART-213 Modify rules S1161, S7055: update descriptions and messages (#4799)
* DART-213 Modify rule S1161: update message details

* S7055: Update description

* Update rule.adoc
2025-03-19 15:28:12 +00:00
github-actions[bot]
74068df10a
Create rule S1862: Related "if/else if" statements should not have the same condition (#4687)
* Add rust to rule S1862

* Add rule description

* Fix errors

* Add link to Clippy lint

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 15:22:56 +00:00
github-actions[bot]
164b14aedc
Create rule S107: Functions should not have too many parameters (#4699)
* Add rust to rule S107

* Update RSPEC

* Remove tag

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
Co-authored-by: Yassin Kammoun <52890329+yassin-kammoun-sonarsource@users.noreply.github.com>
2025-03-19 14:54:18 +00:00
github-actions[bot]
2713aeaed6
Create rule S3498: Field init shorthand should be used (#4727)
* Add rust to rule S3498

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 14:46:55 +00:00
github-actions[bot]
ef35f53a80
Create rule S4325: Redundant casts should be avoided (#4729)
* Add rust to rule S4325

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 14:46:46 +00:00
Yassin Kammoun
c5bb992c80
Create rule S1858: "to_string()" should never be called on a String value (#4730)
* Add rust to rule S1858

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
2025-03-19 14:42:54 +00:00
github-actions[bot]
06ad3ace6f
Create rule S106: Standard outputs should not be used directly to log anything (#4735)
* Add rust to rule S106

* Update RSPEC

* Fix RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 14:40:00 +00:00
github-actions[bot]
bd332080f2
Create rule S7439 Comparisons with overlapping ranges that are always false should not be made (#4782)
* Create rule S7439

* Update rule.adoc

* Update metadata.json

* Update rule.adoc

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:10:52 +00:00
github-actions[bot]
1de188a9e5
Create rule S7443 Calls to std::mem::transmute should not be evaluated eagerly (#4786)
* Create rule S7443

* Update metadata.json

* Update rule.adoc

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:10:47 +00:00
github-actions[bot]
d4cbb1c40b
Create rule S7449 The #[inline] attribute should not be used on trait methods without implementation (#4793)
* Create rule S7449

* Update metadata.json

* Update rule.adoc

* Update rule.adoc

* Update rule.adoc

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:10:41 +00:00
github-actions[bot]
70168e8e61
Create rule S7450 Synchronization locks should not be dropped immediately after acquisition (#4794)
* Create rule S7450

* Update metadata.json

* Update rule.adoc

* Update rule.adoc

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:10:35 +00:00
github-actions[bot]
29af6f4517
Create rule S7438 Incompatible bit masks should not be used in comparisons (#4781)
* Create rule S7438

* Update rule.adoc

* Update metadata.json

* Update metadata.json

* Update metadata.json

* Update rule.adoc

* Update metadata.json

* Update rule.adoc

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:10:14 +00:00
github-actions[bot]
00d540f5ed
Create rule S7437 Variables should be swapped using std::mem::swap (#4780)
* Create rule S7437

* Update rule.adoc

* Update metadata.json

* Update metadata.json

* Update metadata.json

* Update metadata.json

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:10:07 +00:00
github-actions[bot]
a02eec56d4
Create rule S7433 Raw pointers should not be casted to slices with differently sized elements (#4774)
* Create rule S7433

* Update metadata.json

* Update rule.adoc

* Update rule.adoc

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:10:01 +00:00
github-actions[bot]
7b234485eb
Create rule S7428 Case mismatches in pattern arms of match expressions should be avoided (#4769)
* Create rule S7428

* Update rule.adoc

* Update metadata.json

* Update metadata.json

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:09:52 +00:00
github-actions[bot]
8e35213fbb
Create rule S7426 C-like enums should not have unportable variants (#4767)
* Create rule S7426

* Update rule.adoc

* Update metadata.json

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:09:47 +00:00
github-actions[bot]
c83072239e
Create rule S7424 Avoid manual PartialEq implementation with a derived Hash (#4765)
* Create rule S7424

* Update rule.adoc

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:09:42 +00:00
github-actions[bot]
b16523921f
Create rule S7417 Manual PartialOrd implementation should be avoided when Ord is derived (#4757)
* Create rule S7417

* Update rule.adoc

* Update metadata.json

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:09:19 +00:00
github-actions[bot]
cdb05a081b
Create rule S7413 Await should be used for awaitable returns in async blocks and functions (#4752)
* Create rule S7413

* Update rule.adoc

* Update metadata.json

* Update rule.adoc

* Update rule.adoc

* Update metadata.json

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:09:13 +00:00
github-actions[bot]
d17e141be3
Create rule S2198: Unnecessary mathematical comparisons should not be made (#4692)
* Add rust to rule S2198

* Add rule description

* Update rule.adoc

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:09:07 +00:00
github-actions[bot]
feaf726b3a
Create rule S6164: Mathematical constants should not be hardcoded (#4690)
* Add rust to rule S6164

* Add rule description

* Update rule.adoc

* Add link to Clippy lint

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 14:08:57 +00:00
github-actions[bot]
faeaec31d0
Modify rule S5856: Add language Rust (#4678)
* Add rust to rule S5856

* Add rule description

* Fix header

* Add Clippy tag and link to Clippy lint

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 14:08:10 +00:00
github-actions[bot]
f93da5854a
Create rule S1764: Identical expressions should not be used on both sides of a binary operator (#4681)
* Add rust to rule S1764

* Add rule description

* Whitespace

* Update metadata.json

* Fix JSON syntax

* Update rule.adoc

* Update rule.adoc

---------

Co-authored-by: sallaigy <sallaigy@users.noreply.github.com>
Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
2025-03-19 14:07:55 +00:00
github-actions[bot]
aa593087ba
Create rule S6466: Accessing an array element should not trigger a panic (#4684)
* Add rust to rule S6466

* Update RSPEC

* Remove tag

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:59 +00:00
github-actions[bot]
5def9014ed
Create rule S6913: Clamping values with cmp::min and cmp::max should use correct ranges (#4689)
* Add rust to rule S6913

* Update RSPEC

* Remove tag

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:53 +00:00
github-actions[bot]
0b6c98a1f0
Create rule S4962: "std::ptr::null" should be used to denote the null pointer (#4697)
* Add rust to rule S4962

* Remove tag

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:48 +00:00
github-actions[bot]
e34bf94e7d
Create rule S905: Non-empty statements should change control flow or have at least one side-effect (#4698)
* Add rust to rule S905

* Update RSPEC

* Remove tag

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:43 +00:00
github-actions[bot]
8d3cf1eee3
Create rule S1612: Closures should be replaced with function pointers (#4700)
* Add rust to rule S1612

* Update RSPEC

* Remove tag

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:32 +00:00
github-actions[bot]
45cc311cd2
Create rule S2260: Rust source files should not have syntax errors (#4701)
* Add rust to rule S2260

* Update RSPEC

* Add to SonarWay

* Improve rule title

* Remove from Sonar way

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:25 +00:00
github-actions[bot]
99086a587d
Create rule S1116: Empty statements should be removed (#4728)
* Add rust to rule S1116

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:13 +00:00
github-actions[bot]
77af1ab66a
Create rule S1488: Local variables should not be declared and then immediately returned (#4732)
* Add rust to rule S1488

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:38:03 +00:00
github-actions[bot]
6cf7f45131
Create rule S920: Match expression conditions should not have boolean type (#4733)
* Add rust to rule S920

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:58 +00:00
github-actions[bot]
982f059788
Create rule S4275: Getters should access the expected fields (#4734)
* Add rust to rule S4275

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:54 +00:00
github-actions[bot]
dc98004888
Create rule S2193: "while" loop counters should not have floating type (#4736)
* Add rust to rule S2193

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:42 +00:00
github-actions[bot]
90a9b01d26
Create rule S7089: Inline vector literals should be preferred to chains of insertions (#4741)
* Add rust to rule S7089

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:38 +00:00
github-actions[bot]
ff68a34119
Create rule S2148: Underscores should be used to make large numbers readable (#4742)
* Add rust to rule S2148

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:35 +00:00
github-actions[bot]
6ca7dd2cc6
Create rule S2208: Wildcard imports should not be used (#4743)
* Add rust to rule S2208

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:31 +00:00
github-actions[bot]
06526591dd
Create rule S7411: Shared code in all branches should be extracted (#4744)
* Create rule S7411

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:27 +00:00
github-actions[bot]
91eadda5cf
Create rule S126: "if ... else if" constructs should end with "else" clauses (#4747)
* Add rust to rule S126

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:23 +00:00
github-actions[bot]
e94e4d8143
Create rule S7425: MaybeUninit::uninit().assume_init() should not be used (#4766)
* Create rule S7425

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:37:18 +00:00
github-actions[bot]
ea0dd90530
Create rule S7414: Avoid transmutes that can never be correct (#4753)
* Create rule S7414

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:07:55 +00:00
github-actions[bot]
87a178f05b
Create rule S7412: Pointer arithmetic should not be performed on zero-sized types (#4751)
* Create rule S7412

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:07:48 +00:00
github-actions[bot]
ec02230f32
Create rule S7415: Immutable variables should not be used in while loop conditions (#4754)
* Create rule S7415

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:07:33 +00:00
github-actions[bot]
ca818ac21b
Create rule S7418: Lint attributes should not be used on crate imports (#4759)
* Create rule S7418

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:07:29 +00:00
github-actions[bot]
7cf7c53935
Create rule S7419: I/O buffers should be processed entirely (#4760)
* Create rule S7419

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:07:26 +00:00
github-actions[bot]
96bd90a6a9
Create rule S7420: Collections should not be transmuted to different types (#4761)
* Create rule S7420

* Update RSPEC

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:07:22 +00:00
github-actions[bot]
85d974977b
Create rule S7421: Closures of type Fn(...) -> Ord should not return the unit type (#4762)
* Create rule S7421

* Update RSPEC

* Change severity to Critical

---------

Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com>
Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
2025-03-19 13:07:18 +00:00