aureooms/js-cg

View on GitHub

Showing 16 of 42 total issues

Function __convex__ has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

var __convex__ = function ( ccwc ) {

    var convex = function ( a, i, j ) {

        var x, y, z, k, n;
Severity: Minor
Found in js/src/d2/pred/convex.js - About 5 hrs 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 __convex__ has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var __convex__ = function ( ccwc ) {

    var convex = function ( a, i, j ) {

        var x, y, z, k, n;
Severity: Major
Found in js/src/d2/pred/convex.js - About 2 hrs to fix

    Function convex has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var convex = function ( a, i, j ) {
    
            var x, y, z, k, n;
    
            n = j - i;
    Severity: Major
    Found in js/src/d2/pred/convex.js - About 2 hrs to fix

      Function rayshoot has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      let rayshoot = function ( d , m , A , b , z , r ) {
      
          let i = 0 ;
          let j = m ;
          let w ;
      Severity: Minor
      Found in js/src/dn/rayshoot.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

      Function det3 has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      var det3 = function ( A00 , A01 , A02 , A10 , A11 , A12 , A20 , A21 , A22 ) {
      Severity: Major
      Found in js/src/d2/op/det3.js - About 1 hr to fix

        Function __rc__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        var __rc__ = function ( ris ) {
        
            /**
             * Ray casting algorithm.
             * ==
        Severity: Minor
        Found in js/src/d2/pred/rc.js - About 45 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 rayshoot has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        let rayshoot = function ( d , m , A , b , z , r ) {
        Severity: Minor
        Found in js/src/dn/rayshoot.js - About 45 mins to fix

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

              var piq = function ( x , a , b , c , d ) {
          Severity: Minor
          Found in js/src/d2/pred/piq.js - About 35 mins to fix

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

                var rc = function ( polygon , i , j , p , q ) {
            Severity: Minor
            Found in js/src/d2/pred/rc.js - About 35 mins to fix

              Avoid too many return statements within this function.
              Open

                              return false;
              Severity: Major
              Found in js/src/d2/pred/convex.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return ccwc( y, z, x );
                Severity: Major
                Found in js/src/d2/pred/convex.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return false;
                  Severity: Major
                  Found in js/src/d2/pred/convex.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return ccwc( x, y, z );
                    Severity: Major
                    Found in js/src/d2/pred/convex.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return ccwc( z, x, y );
                      Severity: Major
                      Found in js/src/d2/pred/convex.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return false;
                        Severity: Major
                        Found in js/src/d2/pred/convex.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return false;
                          Severity: Major
                          Found in js/src/d2/pred/convex.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language