rochdev/tinto

View on GitHub

Showing 15 of 15 total issues

Function until has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Wait.prototype.until = function(runnable, negate) {
  var self = this;
  var deferred = Q.defer();
  var retryTimeout;
  var lastResults;
Severity: Minor
Found in lib/utils/wait.js - About 1 hr to fix

    Function assert has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function assert(name, callback, message) {
      return function(values) {
        var assertion = this;
        var context = flag(this, 'object');
        var delegate = !!flag(this, 'delegate');
    Severity: Minor
    Found in lib/utils/assert.js - About 1 hr to fix

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

      function TableFooter() {
        Component.apply(this, arguments);
      
        this.getter('rows', function() {
          return this.find('tr').asListOf(Row);
      Severity: Major
      Found in lib/html/components/table/table-footer.js and 1 other location - About 1 hr to fix
      lib/html/components/table/row.js on lines 14..20

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

      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

      function Row() {
        Component.apply(this, arguments);
      
        this.getter('cells', function() {
          return this.find('td,th').asListOf(Cell);
      Severity: Major
      Found in lib/html/components/table/row.js and 1 other location - About 1 hr to fix
      lib/html/components/table/table-footer.js on lines 14..20

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

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

      module.exports = function(chai, utils) {
        ['be', 'and'].forEach(function(chain) {
          chai.Assertion.addProperty(chain, function() {
            return this;
          });
      Severity: Minor
      Found in lib/assertions.js - About 1 hr to fix

        Function locate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        tinto.Locator.prototype.locate = function() {
          var self = this;
          var parent = this.parent && this.parent.getElement() || Q.when(evaluator.getDriver());
        
          if (this.cache && this.id) {
        Severity: Minor
        Found in lib/utils/locator.js - About 1 hr to fix

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

                queue.push(function() {
                  return self.getElement().then(function(element) {
                    return element[method].apply(element, args);
                  });
                });
          Severity: Major
          Found in lib/component.js and 1 other location - About 1 hr to fix
          lib/component.js on lines 182..186

          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

            queue.push(function() {
              return self.getElement().then(function(element) {
                return element.click.apply(element, args);
              });
            });
          Severity: Major
          Found in lib/component.js and 1 other location - About 1 hr to fix
          lib/component.js on lines 328..332

          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

          module.exports = function enabled() {
            return this.getAttribute('disabled').then(function(value) {
              return value === null;
            });
          };
          Severity: Minor
          Found in lib/html/states/enabled.js and 1 other location - About 50 mins to fix
          lib/html/states/disabled.js on lines 8..12

          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

          module.exports = function disabled() {
            return this.getAttribute('disabled').then(function(value) {
              return value !== null;
            });
          };
          Severity: Minor
          Found in lib/html/states/disabled.js and 1 other location - About 50 mins to fix
          lib/html/states/enabled.js on lines 8..12

          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 support has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function support(type, pluralType, name, matcher, args, message) {
          Severity: Minor
          Found in lib/component.js - About 45 mins to fix

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

            tinto.Component.prototype.property = function(name, matcher, args) {
              support.call(this, 'property', 'properties', name, matcher, args, 'Property "%s" does not exist');
            };
            Severity: Minor
            Found in lib/component.js and 1 other location - About 40 mins to fix
            lib/component.js on lines 129..131

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

            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

            tinto.Component.prototype.state = function(name, matcher, args) {
              support.call(this, 'state', 'states', name, matcher, args, 'State "%s" does not exist');
            };
            Severity: Minor
            Found in lib/component.js and 1 other location - About 40 mins to fix
            lib/component.js on lines 138..140

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

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

            tinto.Entity.prototype.getters = function(props) {
              _.forIn(descriptors(props), function(descriptor, prop) {
                if (descriptor.enumerable) {
                  if (descriptor.get) {
                    this.getter(prop, descriptor.get);
            Severity: Minor
            Found in lib/entity.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 support has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function support(type, pluralType, name, matcher, args, message) {
              if (matcher instanceof Array) {
                args = matcher;
                matcher = null;
              }
            Severity: Minor
            Found in lib/component.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