givanse/mvc-tree

View on GitHub

Showing 16 of 16 total issues

Function _genVPathC2N has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  _genVPathC2N(hDelta, vDelta) { // TODO: unit test
    if ( hDelta > 1 ) {
      return vDelta < 1 ? 'v-' + (this.get('svgenv.rowH') / 2) :
                             'v'  + (this.get('svgenv.rowH') / 2);
    } else if ( hDelta === 0 ) {
Severity: Minor
Found in app/mixins/path-factory.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 exports has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(environment) {
  var ENV = {
    modulePrefix: 'mvc-tree',
    environment: environment,
    rootURL: '/',
Severity: Minor
Found in config/environment.js - About 1 hr to fix

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

        } else if ( hDelta === 0 ) {
          if ( vDelta !== 0 ) {
            return vDelta < 1 ? 'v-' + (this.get('svgenv.rowH') / 2) :
                                   'v'  + (this.get('svgenv.rowH') / 2);
          }
    Severity: Major
    Found in app/mixins/path-factory.js and 1 other location - About 1 hr to fix
    app/mixins/path-factory.js on lines 93..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 60.

    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

        } else if ( hDelta === 1 ) {
          if ( vDelta !== 0 ) {
            return vDelta < 1 ? 'v-' + (this.get('svgenv.rowH') / 2) :
                                   'v'  + (this.get('svgenv.rowH') / 2);
          }
    Severity: Major
    Found in app/mixins/path-factory.js and 1 other location - About 1 hr to fix
    app/mixins/path-factory.js on lines 88..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 60.

    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 getBorderPos has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getBorderPos: function(gridNode, options) {
        var x = gridNode.get('x');
        var y = gridNode.get('y');
        var colW = this.get('svgenv.colW');
        var rowH = this.get('svgenv.rowH');
    Severity: Minor
    Found in app/mixins/coordinates-factory.js - About 1 hr to fix

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

            for (var x = 0; x < w; x += svgenv.colW) {
              gridLines.push('M' + x + ' 0 V' + h + ' Z');
            }
      Severity: Major
      Found in app/components/root-svg.js and 1 other location - About 1 hr to fix
      app/components/root-svg.js on lines 45..47

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

      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

            for (var y = 0; y < h; y += svgenv.rowH) {
              gridLines.push('M0 ' + y + ' H' + w + ' Z');
            }
      Severity: Major
      Found in app/components/root-svg.js and 1 other location - About 1 hr to fix
      app/components/root-svg.js on lines 42..44

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

      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 colW = this.get('svgenv.colW'),
              isEnoughSpace = hDelta > 0 ? true : vDelta > 1 ? true : false,
              length = isEnoughSpace ? (colW / 2) : 0;
      Severity: Major
      Found in app/mixins/path-factory.js and 1 other location - About 1 hr to fix
      app/mixins/path-factory.js on lines 58..60

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

      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 colW = this.get('svgenv.colW'),
              isEnoughSpace = hDelta > 0 ? true : vDelta > 1 ? true : false,
              length = isEnoughSpace ? (colW / 2) : 0;
      Severity: Major
      Found in app/mixins/path-factory.js and 1 other location - About 1 hr to fix
      app/mixins/path-factory.js on lines 47..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 55.

      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

        _template: Ember.on('ready', function() {
          var template = 'dpatterns/' + this.get('id');
          this.set('template', template);
        })
      Severity: Minor
      Found in app/models/node-dpattern.js and 1 other location - About 50 mins to fix
      app/models/node-technology.js on lines 15..18

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

      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

        _template: Ember.on('ready', function() {
          var template = 'technologies/' + this.get('id');
          this.set('template', template);
        })
      Severity: Minor
      Found in app/models/node-technology.js and 1 other location - About 50 mins to fix
      app/models/node-dpattern.js on lines 19..22

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

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

        _calcVDelta: function(row1, row2) {
          if ( row1 === row2 ) {
            return 1;
          } else {
            var delta = Math.abs(row1 - row2);
      Severity: Minor
      Found in app/mixins/path-factory.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 generateBindingPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        generateBindingPath: function(a, b) {
          var orderedNodes = this._orderNodes(a, b);
      
          if ( ! orderedNodes ) {
            return null;
      Severity: Minor
      Found in app/mixins/path-factory.js - About 35 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 _genHPathC2Ch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        _genHPathC2Ch(hDelta, vDelta) {
          var colW = this.get('svgenv.colW'),
              isEnoughSpace = hDelta > 0 ? true : vDelta > 1 ? true : false,
              length = isEnoughSpace ? (colW / 2) : 0;
      
      
      Severity: Minor
      Found in app/mixins/path-factory.js - 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

      Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          get: function() {
            // sortBy() returns Array
            var pArr = this.get('model.dpatterns').sortBy('year'), 
                tArr = this.get('model.technologies').sortBy('year');
      
      
      Severity: Minor
      Found in app/controllers/index.js - 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

      Function _genPathC2C has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        _genPathC2C(col1, row1, col2, row2) {
          if ( col1 === col2 && row1 === row2) {
            return null;
          }
      
      
      Severity: Minor
      Found in app/mixins/path-factory.js - 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

      Severity
      Category
      Status
      Source
      Language