AutolabJS/AutolabJS

View on GitHub

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');
Severity: Minor
Found in load_balancer/test/functional/load_balancerTest.js - About 5 hrs to fix

    Function exports has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(socket)
    {
    
    
        if(socket.handshake.session.key)
    Severity: Major
    Found in main_server/admin.js - About 4 hrs to fix

      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();
      Severity: Minor
      Found in main_server/main_server.js - About 3 hrs to fix

        Function exports has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(hostname,rootId,password)
        {
            function getPrivateToken(callback)
            {
                request.post({
        Severity: Major
        Found in main_server/reval/gitlab.js - About 2 hrs to fix

          File configLogic.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          $(document).ready(function() {
            $('.modal-trigger').leanModal();
            $('#logout-navbar').hide();
          
          
          
          Severity: Minor
          Found in main_server/public/js/configLogic.js - About 2 hrs to fix

            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={
            Severity: Minor
            Found in load_balancer/load_balancer.js - About 2 hrs to fix

              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">'+
              Severity: Minor
              Found in main_server/public/js/configLogic.js - About 2 hrs to fix

                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;
                Severity: Minor
                Found in main_server/reval/reval.js - About 1 hr to fix

                  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
                          
                  Severity: Minor
                  Found in docs/examples/io_tests/student_solution/python3/python31.py - About 1 hr to fix

                  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:
                  Severity: Minor
                  Found in docs/examples/unit_tests/test_cases/python3/tests/Test2.py - About 1 hr to fix

                  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:
                  Severity: Minor
                  Found in docs/examples/unit_tests/test_cases/python2/tests/Test2.py - About 1 hr to fix

                  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)
                  Severity: Minor
                  Found in main_server/admin.js - About 1 hr to fix

                  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)
                  Severity: Minor
                  Found in docs/examples/io_tests/student_solution/java/Solution.java - About 55 mins to fix

                  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) {
                  Severity: Major
                  Found in util/test/unit/loggerTest.js - About 50 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  if(current_time - hard < 0)
                                  {
                                    status =2;
                                    penalty=lab_config.Labs[i].penalty;
                                  }
                    Severity: Major
                    Found in main_server/main_server.js - About 45 mins to fix

                      Function submit has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      const submit = function submit(host, idNo, currentLab, commitHash, language) {
                      Severity: Minor
                      Found in tests/test_modules/submit.js - About 35 mins to fix

                        Function revaluation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function revaluation(lab,start_time,end_time,admin_key,callback)
                        Severity: Minor
                        Found in main_server/reval/reval.js - About 35 mins to fix

                          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
                          Severity: Minor
                          Found in docs/examples/io_tests/student_solution/java/Solution.java - About 25 mins to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language