Showing 537 of 537 total issues
Function refreshAvaliability
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
refreshAvaliability(){
for (var i = 0; i < this.skills.length; i++) {
for (var j = 0; j < this.skills[i].parents.length; j++) {
var par = this.skills.find(obj => obj.name == this.skills[i].parents[j]);
- 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
Function drawConnectionLines
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
drawConnectionLines() {
var connectionGroup = new PIXI.display.Group(-1, false);
for (var j = 0; j < this.skills.length; j++) {
if (this.skills[j].children !== undefined) {
- 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
Function refreshAvaliability
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
refreshAvaliability(){
for (var i = 0; i < this.skills.length; i++) {
for (var j = 0; j < this.skills[i].parents.length; j++) {
var par = this.skills.find(obj => obj.name == this.skills[i].parents[j]);
- 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
Function showChart
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showChart() {
document.getElementById('creator').style.display = "none";
document.getElementById('approveTrees').style.display = "none";
document.getElementById('approveSkills').style.display = "none";
document.getElementById('pixiCanvas').style.display = "block";
Function showChart
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showChart() {
document.getElementById('creator').style.display = "none";
document.getElementById('approveTrees').style.display = "none";
document.getElementById('approveSkills').style.display = "none";
document.getElementById('pixiCanvas').style.display = "block";
Function showChart
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showChart() {
document.getElementById('creator').style.display = "none";
document.getElementById('approveTrees').style.display = "none";
document.getElementById('approveSkills').style.display = "none";
document.getElementById('pixiCanvas').style.display = "block";
Function loadSkillToEditor
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSkillToEditor (skill, global) {
document.getElementById('newSkillName').value = skill.name;
document.getElementById('newSkillDesc').value = skill.description;
document.getElementById('newSkillIcon').value = skill.skillIcon;
document.getElementById('newSkillWiki').value = skill.descriptionWikipediaURL;
Function loadSkillToEditor
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSkillToEditor (skill, global) {
document.getElementById('newSkillName').value = skill.name;
document.getElementById('newSkillDesc').value = skill.description;
document.getElementById('newSkillIcon').value = skill.skillIcon;
document.getElementById('newSkillWiki').value = skill.descriptionWikipediaURL;
Function onclick
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadSkill.onclick =function(){
//request for the skill to load data from
var skillname = document.getElementById('newSkillName').value;
skillData = {
Identical blocks of code found in 2 locations. Consider refactoring. Open
function hideMenus () {
document.getElementById('submitBtn').style.display = "none";
var elements = document.getElementsByClassName("hide");
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 94.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
function hideMenus () {
document.getElementById('submitBtn').style.display = "none";
var elements = document.getElementsByClassName("hide");
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 94.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (this.skill.achievedPoint == this.skill.maxPoint) {
this.setFilter(this, nullFilter, maxPointFilter);
} else if (this.skill.achievedPoint > 0){
this.setFilter(this, nullFilter, notNullPointFilter);
} else{
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (var i = 0; i < data.focusArea.treeNames.length; ++i) {
var option = document.createElement('option');
option.value = option.text = data.focusArea.treeNames[i];
mainTree.add(option);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (var i = 0; i < data.focusArea.treeNames.length; ++i) {
var option = document.createElement('option');
option.value = option.text = data.focusArea.treeNames[i];
mainTree.add(option);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (this.skill.achievedPoint == this.skill.maxPoint) {
this.setFilter(this, nullFilter, maxPointFilter);
} else if (this.skill.achievedPoint > 0){
this.setFilter(this, nullFilter, notNullPointFilter);
} else{
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function editTree
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editTree () {
$('.clear').find('input:text').val('');
$('.clear').find('textarea').val('');
hideMenus();
Function editTree
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editTree () {
$('.clear').find('input:text').val('');
$('.clear').find('textarea').val('');
hideMenus();
Function onRightClick
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
onRightClick() {
if (this.parentObj.self) {
var children = this.parentObj.skill.children;
// Decrease skill level
- 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
Function getPublicSkillData
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPublicSkillData(){
var skillToSearch = {value: document.getElementById('cardSearchBar').value};
document.getElementById("searchModalTitle").innerHTML = "Click on a skill, to view its details!";
request('POST', '/protected/getPublicSkillData', skillToSearch, function() {
if(this.readyState == 4 && this.status == 200) {
Function createSkill
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSkill () {
var modal = document.getElementById("newSkillModal");
modal.style.display = "block";
var span = document.getElementById("closeSkillModal");