From e7eefb51f69d1fe90f9c7bab192267d691bc5abd Mon Sep 17 00:00:00 2001 From: zglicz Date: Thu, 5 Dec 2024 16:13:36 +0100 Subject: [PATCH] JS-466 Sync rspec (#5000) --- README.md | 2 +- css-sonarpedia/sonarpedia.json | 2 +- .../javascript/rules/javascript/S1451.json | 4 +++- .../javascript/rules/javascript/S1751.json | 5 ++++- .../javascript/rules/javascript/S1764.json | 4 +++- .../javascript/rules/javascript/S3271.html | 19 ------------------ .../javascript/rules/javascript/S3271.json | 20 ------------------- sonarpedia.json | 2 +- 8 files changed, 13 insertions(+), 45 deletions(-) delete mode 100644 sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.html delete mode 100644 sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.json diff --git a/README.md b/README.md index 798f2bd42b8..a172b7d6b77 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This repository now hosts [eslint-plugin-sonarjs](./packages/jsts/src/rules/READ # Features - Advanced rules based on pattern matching and control flow analysis -- [408 JS rules](https://rules.sonarsource.com/javascript) and [413 TS rules](https://rules.sonarsource.com/typescript) +- [407 JS rules](https://rules.sonarsource.com/javascript) and [413 TS rules](https://rules.sonarsource.com/typescript) - [26 CSS rules](https://rules.sonarsource.com/css) - Compatible with ECMAScript 2015-2020 - React JSX, Flow, Vue, and AWS lambda functions support for JavaScript and TypeScript diff --git a/css-sonarpedia/sonarpedia.json b/css-sonarpedia/sonarpedia.json index ca0176daf36..d9cf7117372 100644 --- a/css-sonarpedia/sonarpedia.json +++ b/css-sonarpedia/sonarpedia.json @@ -3,7 +3,7 @@ "languages": [ "CSS" ], - "latest-update": "2024-11-28T13:47:50.801838Z", + "latest-update": "2024-12-05T14:43:14.216690Z", "options": { "no-language-in-filenames": true } diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1451.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1451.json index 5f7419d49a8..44c423a47b8 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1451.json +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1451.json @@ -12,7 +12,9 @@ "func": "Constant\/Issue", "constantCost": "5min" }, - "tags": [], + "tags": [ + "convention" + ], "defaultSeverity": "Blocker", "ruleSpecification": "RSPEC-1451", "sqKey": "S1451", diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1751.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1751.json index 3ad86fb3a8b..76965a81c10 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1751.json +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1751.json @@ -12,7 +12,10 @@ "func": "Constant\/Issue", "constantCost": "5min" }, - "tags": [], + "tags": [ + "confusing", + "bad-practice" + ], "defaultSeverity": "Major", "ruleSpecification": "RSPEC-1751", "sqKey": "S1751", diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1764.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1764.json index 6b709b41fd0..02b1642d433 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1764.json +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1764.json @@ -12,7 +12,9 @@ "func": "Constant\/Issue", "constantCost": "2min" }, - "tags": [], + "tags": [ + "suspicious" + ], "defaultSeverity": "Major", "ruleSpecification": "RSPEC-1764", "sqKey": "S1764", diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.html deleted file mode 100644 index 57a299945a3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.html +++ /dev/null @@ -1,19 +0,0 @@ -

This rule is deprecated, and will eventually be removed.

-

Why is this an issue?

-

Session storage and local storage are HTML 5 features which allow developers to easily store megabytes of data client-side, as opposed to the 4Kb -cookies can accommodate. While useful to speed applications up on the client side, it can be dangerous to store sensitive information this way because -the data is not encrypted by default and any script on the page may access it.

-

This rule raises an issue when the localStorage and sessionStorage API’s are used.

-

Noncompliant code example

-
-localStorage.setItem("login", login); // Noncompliant
-sessionStorage.setItem("sessionId", sessionId); // Noncompliant
-
-

Resources

- - diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.json deleted file mode 100644 index b3c679920b9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S3271.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "title": "Local storage should not be used", - "type": "VULNERABILITY", - "status": "deprecated", - "remediation": { - "func": "Linear with offset", - "linearDesc": "per additional use of the api", - "linearOffset": "1h", - "linearFactor": "5min" - }, - "tags": [], - "defaultSeverity": "Major", - "ruleSpecification": "RSPEC-3271", - "sqKey": "S3271", - "scope": "Main", - "quickfix": "unknown", - "compatibleLanguages": [ - "JAVASCRIPT" - ] -} diff --git a/sonarpedia.json b/sonarpedia.json index 1f4b9501ff5..ed2c5c47a4e 100644 --- a/sonarpedia.json +++ b/sonarpedia.json @@ -3,7 +3,7 @@ "languages": [ "JS" ], - "latest-update": "2024-11-28T13:46:14.829734Z", + "latest-update": "2024-12-05T14:54:02.136624Z", "options": { "no-language-in-filenames": true, "preserve-filenames": true