Showing 18 of 4,708 total issues
File load_balancerTest.js
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
const chai = require('chai');
const dirtyChai = require('dirty-chai');
const request = require('request');
const nock = require('nock');
const dns = require('dns');
Function exports
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(socket)
{
if(socket.handshake.session.key)
File main_server.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint import/no-dynamic-require: 0 */
var fs = require('fs');
var express = require('express');
var path = require('path');
var app = express();
Function exports
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(hostname,rootId,password)
{
function getPrivateToken(callback)
{
request.post({
File configLogic.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
$(document).ready(function() {
$('.modal-trigger').leanModal();
$('#logout-navbar').hide();
File load_balancer.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint import/no-dynamic-require: 0 */
var fs = require('fs');
var express = require('express');
var app = express();
var https_config={
Function addLab
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addLab(lab)
{
$('<li class = "row" id = "lab'+(++number_of_labs) +'">'+
'<div class="collapsible-header " id = "lab'+(number_of_labs)+'"><i class="material-icons">mode_edit</i>'+lab["Lab_No"]+'<i class = "material-icons right clear_lab" >clear</i></div>'+
'<div class="collapsible-body">'+
Function revaluation
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function revaluation(lab,start_time,end_time,admin_key,callback)
{
var max_scores = {};
var number_of_requests=0;
Function insert
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def insert(root,node):
if(root == None):
root = node
return root
- 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 test
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def test(self):
seller = Seller(2)
score = 0
if seller.sell()==1:
if seller.getQuantity()==1:
- 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 test
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def test(self):
seller = Seller(2)
score = 0
if seller.sell()==1:
if seller.getQuantity()==1:
- 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 exports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(socket)
{
if(socket.handshake.session.key)
- 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
Method search
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private boolean search(BTNode r, int val)
{
if (r.getData() == val)
return true;
if (r.getLeft() != null)
- 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 testLoggingOfTwoLoggers
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
const testLoggingOfTwoLoggers = function testLoggingOfTwoLoggers(logLevel1, logLevel2,
logMessage1, logMessage2, logFile1, logFile2, response) {
Avoid deeply nested control flow statements. Open
if(current_time - hard < 0)
{
status =2;
penalty=lab_config.Labs[i].penalty;
}
Function submit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const submit = function submit(host, idNo, currentLab, commitHash, language) {
Function revaluation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function revaluation(lab,start_time,end_time,admin_key,callback)
Method insert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private BTNode insert(BTNode node, int data)
{
if (node == null)
node = new BTNode(data);
else
- 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"