Showing 240 of 537 total issues
Function approveSkills
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function approveSkills() {
hideMenus();
var approveSkills = document.getElementById("approveSkills");
Function onClick
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
onClick(event) {
if (!event.drag) {
if (this.parentObj.self) {
var children = this.parentObj.skill.children;
- 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 editSkill
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function editSkill () {
document.getElementById('newSkillForm').reset();
var modal = document.getElementById("newSkillModal");
modal.style.display = "block";
- 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 editSkill
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function editSkill () {
document.getElementById('newSkillForm').reset();
var modal = document.getElementById("newSkillModal");
modal.style.display = "block";
- 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 showTree
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showTree (treeName, _data, self) {
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 showTree
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showTree (treeName, _data, self) {
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 showTree
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showTree (treeName, _data, self) {
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 onClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
onClick(event) {
if (!event.drag) {
if (this.parentObj.self) {
var children = this.parentObj.skill.children;
Function onRightClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
onRightClick() {
if (this.parentObj.self) {
var children = this.parentObj.skill.children;
// Decrease skill level
Function refreshAvaliability
has 29 lines of code (exceeds 25 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]);
Function onDragMove
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
onDragMove(event) {
var obj = event.currentTarget;
if (!obj.dragging) return;
var data = obj.dragData;
if (obj.dragging == 1) {
Function onDragMove
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
onDragMove(event) {
var obj = event.currentTarget;
if (!obj.dragging) return;
var data = obj.dragData;
if (obj.dragging == 1) {
Function checkFirstLogin
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkFirstLogin() {
if (data.mainTree != undefined) startLoader();
else {
var modal = document.getElementById('firstLogin');
var btn = document.getElementById('savebtn');
Function getPublicTreeData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPublicTreeData(){
var treeToSearch = {value: document.getElementById('cardSearchBar').value};
document.getElementById("searchModalTitle").innerHTML = "Click on a tree, to add it to your trees!";
request('POST', '/protected/getPublicTreeData', treeToSearch, function() {
if(this.readyState == 4 && this.status == 200) {
Function switchSearch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function switchSearch(type){
document.getElementById('advSearchDetails').innerHTML = "";
if (type === "Skill") {
document.getElementById('cardSearchBar').onkeyup = function(){
if (Array.from(document.getElementById('skillSearchResult').options).find(obj => obj.value == document.getElementById('cardSearchBar').value) == undefined){
Function insertSkill
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function insertSkill(skillToInsert, skillMatrix) {
for (var component = 0; component < skillMatrix.length; component++) {
for (var child = 0; child < skillToInsert.children.length; child++) {
for (var row = 0; row < skillMatrix[component].length; row++) {
if ((skillMatrix[component][row].map(obj => obj.name)).includes(skillToInsert.children[child].name)) {
Function validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validate() {
var loginBox = document.getElementById("loginBox");
var username = document.getElementById("username");
var password1 = document.getElementById("password1");
var password2 = document.getElementById("password2");
Function getPublicTreeData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPublicTreeData(){
var treeToSearch = {value: document.getElementById('cardSearchBar').value};
document.getElementById("searchModalTitle").innerHTML = "Click on a tree, to add it to your trees!";
request('POST', '/protected/getPublicTreeData', treeToSearch, function() {
if(this.readyState == 4 && this.status == 200) {
Function switchSearch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function switchSearch(type){
document.getElementById('advSearchDetails').innerHTML = "";
if (type === "Skill") {
document.getElementById('cardSearchBar').onkeyup = function(){
if (Array.from(document.getElementById('skillSearchResult').options).find(obj => obj.value == document.getElementById('cardSearchBar').value) == undefined){
Function _finishInteractionProcess
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_finishInteractionProcess: function (event, func) {
var queue = this._queue;
var q = queue[0];
var i = 0;
for (; i < q.length; i++) {