AutolabJS/AutolabJS

View on GitHub

Showing 4,708 of 4,708 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const startExecutionNode = function startExecutionNode() {
delete require.cache[require.resolve('../../execute_node.js')];
// eslint-disable-next-line global-require
executeNode = require('../../execute_node.js');
};
Severity: Minor
Found in execution_nodes/test/functional/execute_nodeTest.js and 1 other location - About 45 mins to fix
load_balancer/test/functional/load_balancerTest.js on lines 45..49

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 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

      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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        if(process.env.mode !== "TESTING")
        {
         
        server.listen(config_details.main_server.port);
        console.log("Listening at "+config_details.main_server.port);
        Severity: Minor
        Found in main_server/main_server.js and 1 other location - About 35 mins to fix
        load_balancer/load_balancer.js on lines 303..307

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        if(process.env.mode !== "TESTING")
        {
        server.listen(nodes_data.load_balancer.port);
        console.log("Listening at "+nodes_data.load_balancer.port);
        }
        Severity: Minor
        Found in load_balancer/load_balancer.js and 1 other location - About 35 mins to fix
        main_server/main_server.js on lines 113..118

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        if (testDetails.requestRunNockObj != null) {
        testDetails.requestRunNockObj.isDone().should.equal(testDetails.requestRunVal);
        }
        Severity: Minor
        Found in load_balancer/test/functional/load_balancerTest.js and 1 other location - About 30 mins to fix
        load_balancer/test/functional/load_balancerTest.js on lines 145..147

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        if (testDetails.resultsNockObj != null) {
        testDetails.resultsNockObj.isDone().should.equal(testDetails.resultsVal);
        }
        Severity: Minor
        Found in load_balancer/test/functional/load_balancerTest.js and 1 other location - About 30 mins to fix
        load_balancer/test/functional/load_balancerTest.js on lines 142..144

        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

        Using the '.*' form of import should be avoided - java.io.*.
        Open

        import java.io.*;

        Empty line should be followed by <p> tag on the next line.</p>
        Open

        *

        Each variable declaration must be in its own statement.
        Open

        BTNode left, right;

        Wrong lexicographical order for 'java.text.*' import. Should be before 'java.util.*'.
        Open

        import java.text.*;

        'METHOD_DEF' should be separated from previous line.
        Open

        public void setRight(BTNode n)

        Using the '.*' form of import should be avoided - org.junit.Assert.*.
        Open

        import static org.junit.Assert.*;

        'METHOD_DEF' should be separated from previous line.
        Open

        public void setData(int d)

        'METHOD_DEF' should be separated from previous line.
        Open

        public void insert(int data)

        'if' construct must use '{}'s.
        Open

        if (node == null)

        Empty line should be followed by <p> tag on the next line.</p>
        Open

        *

        'METHOD_DEF' should be separated from previous line.
        Open

        public boolean runTest(Class<?> clazz) {
        Severity
        Category
        Status
        Source
        Language