aureooms/js-gn

View on GitHub

Showing 22 of 22 total issues

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

export function dense_graph_t(){

    var graph = function(){

        this.pt = [];
Severity: Minor
Found in src/undirected/online/data/dense.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 sparse_graph_t has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

export function sparse_graph_t(){

    /**
     * Object constructor
     *
Severity: Minor
Found in src/undirected/online/data/sparse.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 eventour_t has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

export function eventour_t () {

    /**
     * @param {int} fjfj dkdj
     * @param {graph} g
Severity: Minor
Found in src/undirected/offline/algo/eulerian/eventour.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 dense_graph_t has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function dense_graph_t(){

    var graph = function(){

        this.pt = [];
Severity: Major
Found in src/undirected/online/data/dense.js - About 2 hrs to fix

    Function sparse_graph_t has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function sparse_graph_t(){
    
        /**
         * Object constructor
         *
    Severity: Major
    Found in src/undirected/online/data/sparse.js - About 2 hrs to fix

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

          fuse.prototype.vdel = function(v){
              var i = 0, len = this.obj.length;
              for(; i < len; ++i){
                  this.obj[i].vdel(v.pt[i]);
              }
      Severity: Major
      Found in src/undirected/online/data/fuse.js and 1 other location - About 2 hrs to fix
      src/undirected/online/data/fuse.js on lines 53..58

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

      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

          fuse.prototype.edel = function(e){
              var i = 0, len = this.obj.length;
              for(; i < len; ++i){
                  this.obj[i].edel(e.pt[i]);
              }
      Severity: Major
      Found in src/undirected/online/data/fuse.js and 1 other location - About 2 hrs to fix
      src/undirected/online/data/fuse.js on lines 46..51

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

      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 floyd_t has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export function floyd_t(){
      
          var floyd = function(order, dist){
              var i, j, k;
      
      
      Severity: Minor
      Found in src/undirected/offline/algo/sp/floyd.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 index_t has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function index_t(){
      
          var index = function(G, attr){
      
              this.G = G;
      Severity: Minor
      Found in src/undirected/online/data/gindex.js - About 1 hr to fix

        Function eventour_t has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function eventour_t () {
        
            /**
             * @param {int} fjfj dkdj
             * @param {graph} g
        Severity: Minor
        Found in src/undirected/offline/algo/eulerian/eventour.js - About 1 hr to fix

          Function fuse_t has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function fuse_t(){
          
              var fuse = function(){
          
                  this.obj = Array.prototype.slice.call(arguments);
          Severity: Minor
          Found in src/undirected/online/data/fuse.js - About 1 hr to fix

            Function eventour has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var eventour = function ( g, V, i, done, it, tour, edges ) {
            
                    var u, j, z, r, end;
            
                    z = [i, 0];
            Severity: Minor
            Found in src/undirected/offline/algo/eulerian/eventour.js - About 1 hr to fix

              Function dijkstra has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              export function dijkstra ( g, order, source, prev, dist, used, ref, left ) {
              Severity: Major
              Found in src/undirected/offline/algo/sp/dijkstra.js - About 1 hr to fix

                Function simplegraph_t has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                export function simplegraph_t(){
                
                    var simplegraph = function(g, order, dist, h){
                        var V = [], i, j; // link between g and h
                
                
                Severity: Minor
                Found in src/undirected/offline/algo/eulerian/simplegraph.js - About 55 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 eventour has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    var eventour = function ( g, V, i, done, it, tour, edges ) {
                Severity: Major
                Found in src/undirected/offline/algo/eulerian/eventour.js - About 50 mins to fix

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

                              if(j[3][3][3] !== null) j[3][3][3][2] = j[3][3];
                  Severity: Minor
                  Found in src/undirected/online/data/sparse.js and 1 other location - About 50 mins to fix
                  src/undirected/online/data/sparse.js on lines 98..98

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

                  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(i[3][3][3] !== null) i[3][3][3][2] = i[3][3];
                  Severity: Minor
                  Found in src/undirected/online/data/sparse.js and 1 other location - About 50 mins to fix
                  src/undirected/online/data/sparse.js on lines 102..102

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

                  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 fuse_t has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function fuse_t(){
                  
                      var fuse = function(){
                  
                          this.obj = Array.prototype.slice.call(arguments);
                  Severity: Minor
                  Found in src/undirected/online/data/fuse.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 dup has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      var dup = function(g, V, m, next, dist, e){
                  Severity: Minor
                  Found in src/undirected/offline/algo/eulerian/dup.js - About 45 mins to fix

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

                        var dfs = function(g, next, dist, s, t){
                    Severity: Minor
                    Found in src/undirected/offline/algo/sp/sptreedfs.js - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language