aureooms/js-convex-hull-2d

View on GitHub

Showing 19 of 28 total issues

Function _n4 has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

const _n4 = function ( { col , pit } , points , take ) {

    const n = points.length;

    for ( let i = 0 ; i < n ; ++i ) {
Severity: Minor
Found in js/src/0-core/algorithm/_n4.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 _n2 has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

const _n2 = function ( { crs , dot } , points , take ) {

    const n = points.length ;

    each : for ( let j = 0 ; j < n ; ++j ) {
Severity: Minor
Found in js/src/0-core/algorithm/_n2.js - About 4 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 ch_online_add has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

var ch_online_add = function(ch, p){
    if(ch.length == 0){
        ch.push(p);
        return;
    }
Severity: Minor
Found in js/src/0-core/algorithm/_online.js - About 3 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 qhull has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

const qhull = function* ( crs , lex , set , i , j , u , v , w ) {

    let l = i - 1 ;
    let r = j - 1 ;
    let e = r ;
Severity: Minor
Found in js/src/0-core/algorithm/qhull.js - About 3 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 _n3 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

const _n3 = function ( { crs , dot } , points , take ) {

    const n = points.length ;

    for ( let i = 0 ; i < n ; ++i ) {
Severity: Minor
Found in js/src/0-core/algorithm/_n3.js - About 2 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 qhull has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const qhull = function* ( crs , lex , set , i , j , u , v , w ) {

    let l = i - 1 ;
    let r = j - 1 ;
    let e = r ;
Severity: Major
Found in js/src/0-core/algorithm/qhull.js - About 2 hrs to fix

    Function ch_online_add has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var ch_online_add = function(ch, p){
        if(ch.length == 0){
            ch.push(p);
            return;
        }
    Severity: Minor
    Found in js/src/0-core/algorithm/_online.js - About 1 hr to fix

      Function binary_ext_sin_search has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      var binary_ext_sin_search = function(ch, l, r, o, p){
          var i = o;
          while(l < r){
              i = Math.floor((r - l) / 2) + l;
              var p_i = (i - 1) < 0 ? ch.length - 1: i - 1;
      Severity: Minor
      Found in js/src/0-core/algorithm/_online.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 jmarch has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      const jmarch = function* ( crs , dot , points ) {
      
          const n = points.length ;
          const origin = points[0] ;
      
      
      Severity: Minor
      Found in js/src/0-core/algorithm/jmarch.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 qhull has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      const qhull = function* ( crs , lex , set , i , j , u , v , w ) {
      Severity: Major
      Found in js/src/0-core/algorithm/qhull.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                        if ( cos < 0 ) {
                            take[j] = false ;
                            continue each ;
                        }
        Severity: Major
        Found in js/src/0-core/algorithm/_n2.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ( x === i || x === j || x === k || !take[x] ) continue ;
          Severity: Major
          Found in js/src/0-core/algorithm/_n4.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if ( sin2 > 0 ) v = c ;
            Severity: Major
            Found in js/src/0-core/algorithm/_n2.js - About 45 mins to fix

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

              const gscanmono = function ( crs , points , i , j , lo ) {
              
                  const hi = [] ;
              
                  hi.push( points[i] ) ;
              Severity: Minor
              Found in js/src/0-core/algorithm/gscanmono.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

              Avoid deeply nested control flow statements.
              Open

                                  if ( pit( points[x], a, b, c ) ) take[x] = false ;
              Severity: Major
              Found in js/src/0-core/algorithm/_n4.js - About 45 mins to fix

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

                var binary_ext_sin_search = function(ch, l, r, o, p){
                Severity: Minor
                Found in js/src/0-core/algorithm/_online.js - About 35 mins to fix

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

                  const gscanmono = function ( crs , points , i , j , lo ) {
                  Severity: Minor
                  Found in js/src/0-core/algorithm/gscanmono.js - About 35 mins to fix

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

                        const chan = function ( m , set , i , j , hull ) {
                    Severity: Minor
                    Found in js/src/0-core/algorithm/_chan.js - About 35 mins to fix

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

                      const gscan = function ( crs , points , i , j , hull ) {
                      Severity: Minor
                      Found in js/src/0-core/algorithm/gscan.js - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language