aureooms/js-cg

View on GitHub

Showing 42 of 42 total issues

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

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

        var vdot2 = function ( u, v ) {
            return u[0] * v[0] + u[1] * v[1];
        };
        Severity: Minor
        Found in js/src/d2/op/vdot2.js and 1 other location - About 35 mins to fix
        js/src/d2/op/vcross2.js on lines 7..9

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

        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

        var vcross2 = function ( u, v ) {
            return u[0] * v[1] - u[1] * v[0];
        };
        Severity: Minor
        Found in js/src/d2/op/vcross2.js and 1 other location - About 35 mins to fix
        js/src/d2/op/vdot2.js on lines 7..9

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

        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 5 locations. Consider refactoring.
        Open

        var __ccw__ = function ( sinsign ) {
        
            /**
             * Returns true if _c_ lies to the left of segment _ab_
             * in a "right-handed" coordinate system.
        Severity: Major
        Found in js/src/d2/pred/ccw.js and 4 other locations - About 35 mins to fix
        js/src/d2/pred/ccwc.js on lines 3..16
        js/src/d2/pred/colinear.js on lines 3..14
        js/src/d2/pred/cw.js on lines 3..15
        js/src/d2/pred/cwc.js on lines 3..16

        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

        var vadd2 = function ( u, v ) {
            return [ u[0] + v[0], u[1] + v[1] ];
        };
        Severity: Minor
        Found in js/src/d2/op/vadd2.js and 1 other location - About 35 mins to fix
        js/src/d2/op/vsub2.js on lines 7..9

        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 5 locations. Consider refactoring.
        Open

        var __colinear__ = function ( sinsign ) {
        
            /**
             * Returns true if _a_ , _b_ and _c_ are colinear.
             */
        Severity: Major
        Found in js/src/d2/pred/colinear.js and 4 other locations - About 35 mins to fix
        js/src/d2/pred/ccw.js on lines 3..15
        js/src/d2/pred/ccwc.js on lines 3..16
        js/src/d2/pred/cw.js on lines 3..15
        js/src/d2/pred/cwc.js on lines 3..16

        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

        var vsub2 = function ( u, v ) {
            return [ u[0] - v[0], u[1] - v[1] ];
        };
        Severity: Minor
        Found in js/src/d2/op/vsub2.js and 1 other location - About 35 mins to fix
        js/src/d2/op/vadd2.js on lines 7..9

        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 5 locations. Consider refactoring.
        Open

        var __cw__ = function ( sinsign ) {
        
            /**
             * Returns true if _c_ lies to the right of segment _ab_
             * in a "right-handed" coordinate system.
        Severity: Major
        Found in js/src/d2/pred/cw.js and 4 other locations - About 35 mins to fix
        js/src/d2/pred/ccw.js on lines 3..15
        js/src/d2/pred/ccwc.js on lines 3..16
        js/src/d2/pred/colinear.js on lines 3..14
        js/src/d2/pred/cwc.js on lines 3..16

        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 5 locations. Consider refactoring.
        Open

        var __ccwc__ = function ( sinsign ) {
        
            /**
             * Returns true if _c_ lies to the left of segment _ab_
             * or if _a_ , _b_ and _c_ are colinear in a
        Severity: Major
        Found in js/src/d2/pred/ccwc.js and 4 other locations - About 35 mins to fix
        js/src/d2/pred/ccw.js on lines 3..15
        js/src/d2/pred/colinear.js on lines 3..14
        js/src/d2/pred/cw.js on lines 3..15
        js/src/d2/pred/cwc.js on lines 3..16

        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 5 locations. Consider refactoring.
        Open

        var __cwc__ = function ( sinsign ) {
        
            /**
             * Returns true if _c_ lies to the right of segment _ab_
             * or if _a_ , _b_ and _c_ are colinear in a
        Severity: Major
        Found in js/src/d2/pred/cwc.js and 4 other locations - About 35 mins to fix
        js/src/d2/pred/ccw.js on lines 3..15
        js/src/d2/pred/ccwc.js on lines 3..16
        js/src/d2/pred/colinear.js on lines 3..14
        js/src/d2/pred/cw.js on lines 3..15

        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

        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

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

            var DCELFace = function ( ) {
            
                this.edge = null ;
            
                this.iterator = null ;
            Severity: Minor
            Found in js/src/d2/dcel/DCELFace.js and 1 other location - About 30 mins to fix
            js/src/d2/dcel/DCELVertex.js on lines 2..9

            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

            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

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

              var DCELVertex = function ( ) {
              
                  this.leaving = null ;
              
                  this.iterator = null ;
              Severity: Minor
              Found in js/src/d2/dcel/DCELVertex.js and 1 other location - About 30 mins to fix
              js/src/d2/dcel/DCELFace.js on lines 2..9

              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

              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
                  Severity
                  Category
                  Status
                  Source
                  Language