From 41ac83c553ed53d93b061f20f110da061150fed6 Mon Sep 17 00:00:00 2001 From: Dorian Burihabwa <75226315+dorian-burihabwa-sonarsource@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:02:08 +0200 Subject: [PATCH] [NO-JIRA] Update rules metadata (#20) --- .../resources/org/sonar/l10n/scala/rules/scapegoat/rules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-scala-plugin/src/main/resources/org/sonar/l10n/scala/rules/scapegoat/rules.json b/sonar-scala-plugin/src/main/resources/org/sonar/l10n/scala/rules/scapegoat/rules.json index a81d6f1..32efddd 100644 --- a/sonar-scala-plugin/src/main/resources/org/sonar/l10n/scala/rules/scapegoat/rules.json +++ b/sonar-scala-plugin/src/main/resources/org/sonar/l10n/scala/rules/scapegoat/rules.json @@ -349,7 +349,7 @@ { "key": "com.sksamuel.scapegoat.inspections.controlflow.WhileTrue", "name": "Checks for code that uses a `while(true)` or `do { } while(true)` block.", - "description": "Checks for code that uses a `while(true)` or `do { } while(true)` block. \u003cbr/\u003e\n*Rationale*: This type of code is usually not meant for production as it will not return normally. If you need to loop until interrupted, then consider using a flag. \u003cbr/\u003e\n### Suppressing Warnings by Method or Class \u003cbr/\u003e\nYou can suppress a specific warning by method or by class using the java.lang.SuppressWarnings annotation. \u003cbr/\u003e\nUse the simple name of the inspection to be ignored as the argument, or use \u0026quot;all\u0026quot; to suppress all scapegoat warnings in the specified scope. \u003cbr/\u003e\nSome examples: \u003cbr/\u003e\n```scala \u003cbr/\u003e\n@SuppressWarnings(Array(\u0026quot;all\u0026quot;)) \u003cbr/\u003e\nclass Test { \u003cbr/\u003e\n def hello: Unit \u003d { \u003cbr/\u003e\n val s: Any \u003d \u0026quot;sammy\u0026quot; \u003cbr/\u003e\n println(s.asInstanceOf[String]) \u003cbr/\u003e\n } \u003cbr/\u003e\n} \u003cbr/\u003e\nclass Test2 { \u003cbr/\u003e\n @SuppressWarnings(Array(\u0026quot;AsInstanceOf\u0026quot;)) \u003cbr/\u003e\n def hello: Unit \u003d { \u003cbr/\u003e\n val s: Any \u003d \u0026quot;sammy\u0026quot; \u003cbr/\u003e\n println(s.asInstanceOf[String]) \u003cbr/\u003e\n } \u003cbr/\u003e\n} \u003cbr/\u003e\n``` \u003cbr/\u003e\n## Other static analysis tools: \u003cbr/\u003e\n* ScalaStyle (Scala) - https://github.com/scalastyle/scalastyle/wiki \u003cbr/\u003e\n* Linter (Scala) - https://github.com/HairyFotr/linter \u003cbr/\u003e\n* WartRemover (Scala) - https://github.com/puffnfresh/wartremover \u003cbr/\u003e\n* Findbugs (JVM) - http://findbugs.sourceforge.net/bugDescriptions.html \u003cbr/\u003e\n* Fb-contrib (JVM) - http://fb-contrib.sourceforge.net/ \u003cbr/\u003e\n* CheckStyle (Java) - http://checkstyle.sourceforge.net/availablechecks.html \u003cbr/\u003e\n* PMD (Java) - http://pmd.sourceforge.net/pmd-5.0.3/rules/index.html \u003cbr/\u003e\n* Error-prone (Java) - https://github.com/google/error-prone \u003cbr/\u003e\n* CodeNarc (Groovy) - http://codenarc.sourceforge.net/codenarc-rule-index.html \u003cbr/\u003e\n* PVS-Studio (C++) - http://www.viva64.com/en/d/ \u003cbr/\u003e\n* Coverity (C++) - http://www.slideshare.net/Coverity/static-analysis-primer-22874326 (6,7) \u003cbr/\u003e\n* CppCheck (C++) - http://cppcheck.sourceforge.net/ \u003cbr/\u003e\n* OCLint (C++/ObjC) - http://docs.oclint.org/en/dev/rules/index.html \u003cbr/\u003e\n* JSHint (Javascript) - http://jshint.com/ \u003cbr/\u003e\n* JavascriptLint (Javascript) - http://www.javascriptlint.com/ \u003cbr/\u003e\n* ClosureLinter (Javascript) - https://developers.google.com/closure/utilities/ \u003cbr/\u003e\n", + "description": "Checks for code that uses a `while(true)` or `do { } while(true)` block. \u003cbr/\u003e\n*Rationale*: This type of code is usually not meant for production as it will not return normally. If you need to loop until interrupted, then consider using a flag. \u003cbr/\u003e\n", "type": "CODE_SMELL", "severity": "MAJOR", "url": "https://github.com/sksamuel/scapegoat/blob/master/README.md#inspections"