Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javascript issues caught in sonarqube dashboard missing in cnes report #389

Open
fayazahamad opened this issue Mar 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fayazahamad
Copy link

fayazahamad commented Mar 4, 2024

javascript issues caught in sonarqube dashboard missing in cnes report

i have a project with multiplr languages, java, html, css, java script where all of these related issues are showing up in sonarqube but CNES report missing java script issues, please find table copied from report and screen shots from sonar dashboard

To reproduce

image

image

<style> </style>
Name Description Type Severity Number
CSS properties should be valid The W3C specifications define the valid CSS properties. Only the official and browser-specific properties should be used to get the expected impact in the final rendering. This rule ignores:     $sass, @less, and var(--custom-property) variable syntaxes.     vendor-prefixed properties (e.g., -moz-align-self, -webkit-align-self).   Noncompliant Code Example  a {   colour: blue; /* Noncompliant; colour is not part of the specifications */ }  Compliant Solution  a {   color: blue; } BUG BLOCKER 19
Shorthand properties that override related longhand properties should be avoided A shorthand property defined after a longhand property will completely override the value defined in the longhand property making the longhand one useless. The code should be refactored to consider the longhand property or to remove it completely. Noncompliant Code Example  a {   padding-left: 10px;   padding: 20px; /* Noncompliant; padding is overriding padding-left making it useless / }  Compliant Solution  a {   padding: 10px; / Compliant; padding is defining a general behaviour and padding-left, just after, is precising the left case */   padding-left: 20px; }  See     Mozilla Web Technology for Developers - Shorthand   properties BUG CRITICAL 3
Selectors should be known HTML, SVG, and MathML define the selectors which can be used in a CSS. A selector that is not part of them is likely to be a typo or a misunderstanding of the CSS syntax. Noncompliant Code Example  field {}  ul list {}  Compliant Solution  input {}  ul li {} BUG CRITICAL 3
Results of "in" and "instanceof" should be negated rather than operands Mixing up the order of operations will almost always yield unexpected results. Similarly, mis-applied negation will also yield bad results. For instance consider the difference between !key in dict and !(key in dict). The first looks for a boolean value (!key) in dict, and the other looks for a string and inverts the result. !obj instanceof SomeClass has the same problem. This rule raises an issue when the left operand of an in or instanceof operator is negated. Noncompliant Code Example  if (!"prop" in myObj) {  // Noncompliant;  "in" operator is checking property "false"   doTheThing();  // this block will be never executed }  if (!foo instanceof MyClass) {  // Noncompliant; "!foo" returns a boolean, which is not an instance of anything   doTheOtherThing();  // this block is never executed }  Compliant Solution  if (!("prop" in myObj)) {   doTheThing(); }  if (!(foo instanceof MyClass)) {   doTheOtherThing(); } BUG CRITICAL 3
@fayazahamad fayazahamad added the bug Something isn't working label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant