Skip to content

Showcase of uploading SARIF to GH checks #3

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions with-config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

const regex2 = /\d/;

const regexBad = /[0-9]/;

Check failure

Code scanning / ESLint

Improve regexes by making them shorter, consistent, and safer. Error

/[0-9]/ can be optimized to /\d/.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: /[0-9]/ can be optimized to /\d/.

Suggested change
const regexBad = /[0-9]/;
const regexBad = /\d/;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Unexpected character class '[0-9]'. Use '\d' instead.

Suggested change
const regexBad = /[0-9]/;
const regexBad = /\d/;


console.log(regexBad)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Insert ;

Suggested change
console.log(regexBad)
console.log(regexBad);


const regexUnused = /\d/;

Check failure on line 19 in with-config-file.js

View check run for this annotation

Codacy Development / Codacy Static Code Analysis

with-config-file.js#L19

'regexUnused' is assigned a value but never used.

Check failure on line 19 in with-config-file.js

View check run for this annotation

Codacy Development / Codacy Static Code Analysis

with-config-file.js#L19

'regexUnused' is assigned a value but never used.

Check failure

Code scanning / ESLint

Disallow unused variables Error

'regexUnused' is assigned a value but never used.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical Error Prone issue: 'regexUnused' is assigned a value but never used.

The issue identified by the ESLint linter is that the variable regexUnused is assigned a value but is never used in the code. This can lead to unnecessary memory usage and can be confusing for anyone reading the code, as it suggests that the variable should be used somewhere, but it is not.

To fix this issue, we should remove the unused variable declaration.

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical Error Prone issue: 'regexUnused' is assigned a value but never used.

The issue identified by ESLint is that the variable regexUnused is declared and assigned a value, but it is never used in the code. This is considered an error-prone practice because it indicates that the code contains unnecessary or dead code, which can lead to confusion and maintainability issues.

To fix this issue, you should remove the unused variable. Here is the code suggestion to fix the issue:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

By commenting out or removing the declaration of regexUnused, you eliminate the unused variable, thus resolving the ESLint error.


This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical Error Prone issue: 'regexUnused' is assigned a value but never used.

The issue with the line const regexUnused = /\d/; is that the variable regexUnused is declared and assigned a regular expression, but it is never used in the code. This can lead to unnecessary clutter in the codebase and may confuse other developers who might wonder about the purpose of this unused variable.

To fix this issue, you can simply remove the declaration of regexUnused, as it serves no purpose in the current code. Here's the single line change to address this:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical Error Prone issue: 'regexUnused' is assigned a value but never used.

The issue with the line const regexUnused = /\d/; is that the variable regexUnused is declared and assigned a value, but it is never used in the code. This can lead to unnecessary clutter and confusion, as it suggests that there might be an intended use for this regex that is missing.

To fix this issue, you can simply remove the unused variable declaration. Here is the single line change to address the ESLint warning:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue indicated by the ESLint linter is that the variable regexUnused is declared and assigned a value, but it is never used anywhere in the code. This can lead to unnecessary clutter and confusion in the codebase, as it suggests that there may have been an intention to use this regex but it was ultimately left unused.

To fix this issue, you can simply remove the declaration of regexUnused since it serves no purpose in the current code. Here’s the suggested single line change:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue is that the variable regexUnused is declared and assigned a regular expression value, but it is never used in the code. This is considered a code smell, as it indicates that there may be unnecessary or leftover code that does not serve any purpose.

To fix this issue, you can simply remove the unused variable declaration. Here's the single line change to address the ESLint warning:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue identified by ESLint is that the variable regexUnused is declared and assigned a regular expression value, but it is never used in the code. This can lead to unnecessary clutter in the codebase, as it suggests that there may have been an intention to use this variable which was not fulfilled.

To address this issue, you can simply remove the unused variable declaration. Here’s the suggested change:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue is that the variable regexUnused is declared and assigned a regular expression but is never used in the code. This results in a warning from ESLint indicating that the variable is unnecessary and can be removed to improve code cleanliness.

To fix this issue, you can simply remove the declaration of regexUnused. Here’s the code suggestion:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue reported by ESLint9 is that the variable regexUnused is declared and assigned a value, but it is never used anywhere in the code. This can lead to unnecessary code clutter and may indicate that the variable is not needed.

To resolve this issue, you can simply remove the unused variable declaration. Here’s the single line change suggestion:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue highlighted by ESLint indicates that the variable regexUnused is declared and assigned a regular expression value, but it is never used anywhere in the code. This can lead to unnecessary code clutter and may confuse other developers who might wonder why the variable exists.

To fix this issue, you can simply remove the declaration of regexUnused, as it's not being utilized. Here’s the single line change to address the problem:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue identified by the ESLint linter is that the variable regexUnused is defined and assigned a regular expression but is never used in the code. This can lead to unnecessary code clutter, making it harder to maintain and understand.

To fix this issue, you can simply remove the unused variable declaration. Here’s the single line change to address the problem:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue is that the variable regexUnused is declared and assigned a regular expression value, but it is never used anywhere in the code. This leads to an unused variable warning from ESLint, indicating that the variable is unnecessary and can be removed or utilized.

To fix the issue, you can simply remove the declaration of regexUnused. Here’s the code suggestion:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue identified by ESLint is that the variable regexUnused is declared and assigned a regular expression value, but it is never used anywhere in the code. This can lead to unnecessary clutter in the codebase and may indicate that the variable was intended to be used but was overlooked.

To fix this issue, you can simply remove the unused variable declaration. Here's the single line change:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This change will eliminate the variable that is not being used, thus resolving the ESLint warning.


This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue identified by ESLint indicates that the variable regexUnused is declared and assigned a value, but it is never used anywhere in the code. This can lead to unnecessary clutter in the codebase and can be confusing for other developers, as it suggests that there might have been an intention to use it.

To resolve this issue, you can simply remove the unused variable declaration. Here's the single line change to fix the issue:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical ErrorProne issue: 'regexUnused' is assigned a value but never used.

The issue identified by ESLint is that the variable regexUnused is declared and assigned a value, but it is never used anywhere in the code. This can lead to unnecessary clutter in the codebase and may indicate that the variable was intended for use but was forgotten.

To fix this issue, you can simply remove the unused variable declaration. Here’s the suggested change:

Suggested change
const regexUnused = /\d/;
// const regexUnused = /\d/;

This comment was generated by an experimental AI tool.


var o = {d: 1};
Object.defineProperty(o, 'c', {
set: function(value) {
Expand Down
Loading