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

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

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

Further Reading

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

        request.get({url:"https://"+hostname + "/api/v3/users?username="+username + "&private_token="+private_token,
            cert:ssl.cert,
            key:ssl.key,
            rejectUnauthorized:false },
Severity: Minor
Found in main_server/reval/gitlab.js and 1 other location - About 45 mins to fix
main_server/reval/gitlab.js on lines 66..69

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

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

Further Reading

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

      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

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

      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

      Further Reading

      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

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

      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

      Further Reading

      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

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

      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

      Further Reading

      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

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

      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

      Further Reading

      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

      'CLASS_DEF' should be separated from previous line.
      Open

      class Seller

      Checks for empty line separators before package, all import declarations,fields, constructors, methods, nested classes,static initializers and instance initializers.

      Checks for empty line separators before not only statements butimplementation and documentation comments and blocks as well.

      ATTENTION: empty line separator is required between token siblings,not after line where token is found.If token does not have same type sibling then empty lineis required at its end (for example for CLASS_DEF it is after '}').Also, trailing comments are skipped.

      ATTENTION: violations from multiple empty lines cannot be suppressed via XPath:#8179.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      'CLASS_DEF' should be separated from previous line.
      Open

      class Driver

      Checks for empty line separators before package, all import declarations,fields, constructors, methods, nested classes,static initializers and instance initializers.

      Checks for empty line separators before not only statements butimplementation and documentation comments and blocks as well.

      ATTENTION: empty line separator is required between token siblings,not after line where token is found.If token does not have same type sibling then empty lineis required at its end (for example for CLASS_DEF it is after '}').Also, trailing comments are skipped.

      ATTENTION: violations from multiple empty lines cannot be suppressed via XPath:#8179.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      'METHOD_DEF' should be separated from previous line.
      Open

          @Before

      Checks for empty line separators before package, all import declarations,fields, constructors, methods, nested classes,static initializers and instance initializers.

      Checks for empty line separators before not only statements butimplementation and documentation comments and blocks as well.

      ATTENTION: empty line separator is required between token siblings,not after line where token is found.If token does not have same type sibling then empty lineis required at its end (for example for CLASS_DEF it is after '}').Also, trailing comments are skipped.

      ATTENTION: violations from multiple empty lines cannot be suppressed via XPath:#8179.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

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

           *

      Checks the Javadoc paragraph.

      Checks that:

      • There is one blank line between each of two paragraphs.
      • Each paragraph but the first has <p> immediately before the first word, withno space after.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      Top-level class BTNode has to reside in its own source file.
      Open

      class BTNode

      Checks that each top-level class, interface, enumor annotation resides in a source file of its own.Official description of a 'top-level' term:7.6. Top Level Type Declarations.If file doesn't contains public class, interface, enum or annotation,top-level type is the first type in file.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      'METHOD_DEF' should be separated from previous line.
      Open

          public BTNode getLeft()

      Checks for empty line separators before package, all import declarations,fields, constructors, methods, nested classes,static initializers and instance initializers.

      Checks for empty line separators before not only statements butimplementation and documentation comments and blocks as well.

      ATTENTION: empty line separator is required between token siblings,not after line where token is found.If token does not have same type sibling then empty lineis required at its end (for example for CLASS_DEF it is after '}').Also, trailing comments are skipped.

      ATTENTION: violations from multiple empty lines cannot be suppressed via XPath:#8179.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      'METHOD_DEF' should be separated from previous line.
      Open

          public void setData(int d)

      Checks for empty line separators before package, all import declarations,fields, constructors, methods, nested classes,static initializers and instance initializers.

      Checks for empty line separators before not only statements butimplementation and documentation comments and blocks as well.

      ATTENTION: empty line separator is required between token siblings,not after line where token is found.If token does not have same type sibling then empty lineis required at its end (for example for CLASS_DEF it is after '}').Also, trailing comments are skipped.

      ATTENTION: violations from multiple empty lines cannot be suppressed via XPath:#8179.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      Parameter name 'd' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
      Open

          public void setData(int d)

      Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

      To validate catch parameters please useCatchParameterName.

      To validate lambda parameters please useLambdaParameterName.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

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

      import java.io.*;

      Checks that there are no import statements that use the * notation.

      Rationale: Importing all classes from a package or staticmembers from a class leads to tight coupling between packagesor classes and might lead to problems when a new version of alibrary introduces name clashes.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      Array brackets at illegal position.
      Open

        public static void main(String args[])

      Checks the style of array type definitions. Some like Java style:public static void main(String[] args) and some likeC style: public static void main(String args[]).

      By default the Check enforces Java style.

      This check strictly enforces only Java style for method return typesregardless of the value for 'javaStyle'. For example, byte[] getData().This is because C doesn't compile methods with array declarations on the name.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      Local variable name 'x' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
      Open

          Test x=new Test();

      Checks that local, non-final variable names conform to a specified pattern.A catch parameter is considered to be a local variable.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      Severity
      Category
      Status
      Source
      Language