Showing 537 of 537 total issues
Function getChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function getChildren (skills, skill, children) {
var temp = [];
for (var i = 0; skill.children != undefined && i < skill.children.length; ++i) {
var child = skills.find(obj => obj.name == skill.children[i].name);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
Open
if(this.response!=null)
for(var i=0;i<this.response.length;i++)
{
addRow("trainingsTable");
Avoid deeply nested control flow statements. Open
Open
if (this.skills[j].achievedPoint < minPoint || child.lowAPParents != undefined) {
child.itemcontainer.disable();
if (child.lowAPParents === undefined) {
child.lowAPParents = new Array();
Avoid deeply nested control flow statements. Open
Open
if(this.response!=null)
for(var i=0;i<this.response.length;i++)
{
addRow("parentsTable");
Avoid deeply nested control flow statements. Open
Open
if (skillList.options[j].text == children[i].name) skillList.remove(j);
Avoid deeply nested control flow statements. Open
Open
if (this.skills[j].achievedPoint < minPoint || child.lowAPParents != undefined) {
child.itemcontainer.disable();
if (child.lowAPParents === undefined) {
child.lowAPParents = new Array();
Avoid deeply nested control flow statements. Open
Open
if (this.skills[i].itemcontainer.skillborder.endorsement != undefined) this.skills[i].itemcontainer.skillborder.endorsement.filters = [colorMatrixFilter];
Avoid deeply nested control flow statements. Open
Open
if (confirm(text)) {
skillsToAdd.push(this.response.skill);
var option = document.createElement("option");
option.text = this.response.skill.name;
skillList.add(option);
Avoid deeply nested control flow statements. Open
Open
if (globalSkill.offers.find(obj => obj.username == user.username) != undefined) {
globalSkills.find(obj => obj.name == userSkill.name).offers = globalSkill.offers.filter(obj => obj.username != user.username);
}
Function createTableRow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createTableRow( data1, data2, data3, data4, data5, classname )
Avoid deeply nested control flow statements. Open
Open
if (this.response.success) showBottomAlert('success', "Password changed successfully!");
else showBottomAlert("danger", "Wrong password!");
Avoid deeply nested control flow statements. Open
Open
if (this.skills[i].itemcontainer.skillborder.endorsement != undefined) this.skills[i].itemcontainer.skillborder.endorsement.filters = null;
Avoid deeply nested control flow statements. Open
Open
if (skillMatrix[component][row + 1] == undefined) skillMatrix[component].push([]);
Avoid deeply nested control flow statements. Open
Open
if (this.skills[i].itemcontainer.skillborder.endorsement != undefined) this.skills[i].itemcontainer.skillborder.endorsement.filters = null;
Avoid deeply nested control flow statements. Open
Open
else if (displayObject.containsPoint) {
if (displayObject.containsPoint(point)) {
hit = displayObject.displayOrder;
}
}
Avoid deeply nested control flow statements. Open
Open
if (globalSkill.offers.find(obj => obj.username == user.username) == undefined) {
globalSkills.find(obj => obj.name == userSkill.name).offers.push({
username: user.username,
location: user.location,
teachingDay: user.teachingDay,
Avoid deeply nested control flow statements. Open
Open
if (displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {
hit = displayObject.displayOrder;
}
Avoid deeply nested control flow statements. Open
Open
if (row == 0) {
await addRowToComponent(skillMatrix, component);
skillMatrix[component][0].push(skillToInsert);
// console.log(skillToInsert.name + " added to root(skills child found in tree)"); // for debugging reasons
// this checks if the row found was the root level.
Function getChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function getChildren (skills, skill, children) {
var temp = [];
for (var i = 0; skill.children != undefined && i < skill.children.length; ++i) {
var child = skills.find(obj => obj.name == skill.children[i].name);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
Open
if (this.skills[i].itemcontainer.skillborder.endorsement != undefined) this.skills[i].itemcontainer.skillborder.endorsement.filters = [colorMatrixFilter];