Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 12 additions & 3 deletions src/client/api.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
function foo1(a, b, a) {
function foo1(a, b, c) {
Copy link
Collaborator

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: Missing JSDoc comment.

Suggested change
function foo1(a, b, c) {
/**

typeof a === undefined
console.log("value of the second a:", a);
}

var bar = function (a, b, a) {
var bar = function (a, b, c) {
console.log("value of the second a:", a);
};
};

var car = function (a, b, c) {
console.log("value of the second c:", c);

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: Strings must use singlequote.

Suggested change
console.log("value of the second c:", c);
console.log('value of the second c:', c);

Copy link
Collaborator

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: Strings must use singlequote.

Suggested change
console.log("value of the second c:", c);
console.log('value of the second c:', c);

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: Strings must use singlequote.

Suggested change
console.log("value of the second c:", c);
console.log('value of the second c:', c);

};

var dar = function (a, b, c, d) {
console.log("value of the second d:", d);

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: Strings must use singlequote.

Suggested change
console.log("value of the second d:", d);
console.log('value of the second d:', d);

Copy link
Collaborator

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: Strings must use singlequote.

Suggested change
console.log("value of the second d:", d);
console.log('value of the second d:', d);

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: Strings must use singlequote.

Suggested change
console.log("value of the second d:", d);
console.log('value of the second d:', d);

};

21 changes: 20 additions & 1 deletion src/server/lib/example.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
exports.pluralize = function (count, singular, plural) {
if (count === 1) {
console.log("forgotten debug statement. Smaller Change")
return `${count} ${singular}`;
}
plural = plural || `${singular}s`;
Expand Down Expand Up @@ -61,4 +62,22 @@ exports.ransomNote = function(note, magazine) {
});

return possible;
};
};

exports.pluralize_v2 = function (count, singular, plural) {
if (count === 1) {
return `${count} ${singular}`;
}
plural = plural || `${singular}s`;
return `${count} ${plural}`;
};

exports.method = function (count) {
for(let i = 0; i < count; i++){
const j = 9
while(j>count){
console.log("counting")
j--
}
}
};
1 change: 1 addition & 0 deletions src/server/lib/notsogoodpeople.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var child_process = require('child_process');
exports.doSomething = function () {

for (var i = 0; i < 10; i--) {
console.log('ESLint should catch this');
}

for (var i = 10; i >= 0; i++) {
Expand Down
76 changes: 76 additions & 0 deletions src/server/lib/person.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"use strict";
var fs = require("fs");
exports.doSomething = function() {

for (var i = 0; i < 10; i--) {
}

for (var i = 10; i >= 0; i++) {
}

var x = 5;;

var key = 'key'

var object = {
key: 'yes! '
}

if (!key in object) {
// operator precedence makes it equivalent to (!key) in object
// and type conversion makes it equivalent to (key ? "false" : "true") in object
}

};

function foo(a, b, a) {
typeof a === undefined
console.log("value of the second a:", a);
}

var bar = function (a, b, a) {
console.log("value of the second a:", a);
};

function fn() {
x = 1;
return x;
x = 3; // this will never execute
}

(() => {
try {
return 1; // 1 is returned but suspended until finally block ends
} catch (err) {
return 2;
} finally {
return 3; // 3 is returned before 1, which we did not expect
}
})();

let foo = function () {
try {
return 1;
} catch (err) {
return 2;
} finally {
return 3;
}
};

let result;
async function foo() {
result += await somethingElse;

result = result + await somethingElse;

result = result + doSomething(await somethingElse);
}

function* bar() {
result += yield;

result = result + (yield somethingElse);

result = result + doSomething(yield somethingElse);
}