pranavjha/chai-a11y

View on GitHub

Showing 13 of 13 total issues

Function exports has 388 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {
    // loading the npm task
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-docco-plus');
    grunt.loadNpmTasks('grunt-gh-pages');
Severity: Major
Found in Gruntfile.js - About 1 day to fix

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

        response.filter(function(item) {
            // filter all the FAILed cases
            return (item.result === 'FAIL');
        }).forEach(function(item) {
            // get the important information in the string to be returned
    Severity: Major
    Found in lib/utils/stringify-response.js and 1 other location - About 6 hrs to fix
    lib/index.js on lines 58..71

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

    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

            response.filter(function(item) {
                return (item.result === 'FAIL');
            }).forEach(function(item) {
                // get the important information in the string to be returned
                message += ('\nrule name:       ' + item.rule.name);
    Severity: Major
    Found in lib/index.js and 1 other location - About 6 hrs to fix
    lib/utils/stringify-response.js on lines 5..19

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

    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

    File Gruntfile.js has 419 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    var path = require('path');
    // js-hint options. See the complete list of options [here](http://jshint.com/docs/options/)
    var jshintOptions = {
        nonew: true,
    Severity: Minor
    Found in Gruntfile.js - About 6 hrs to fix

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

      module.exports = function(config) {
          config = config || {};
          config.ignore = config.ignore || [];
          if (typeof config.ignore === 'string') {
              config.ignore = [
      Severity: Major
      Found in lib/utils/normalize-config.js and 1 other location - About 4 hrs to fix
      lib/index.js on lines 36..54

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

      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

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

          var normalizeConfig = function(config) {
              config = config || {};
              config.ignore = config.ignore || [];
              if (typeof config.ignore === 'string') {
                  config.ignore = [
      Severity: Major
      Found in lib/index.js and 1 other location - About 4 hrs to fix
      lib/utils/normalize-config.js on lines 4..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 127.

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

          var chaiAccessibility = function(chai, utils, modules) {
              /* global document */
              var $ = modules.$;
              var Assertion = chai.Assertion;
              Assertion.addMethod('accessible', function(config) {
      Severity: Minor
      Found in lib/index.js - About 1 hr to fix

        Function chaiAccessibility has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function chaiAccessibility(chai) {
            var Assertion = chai.Assertion;
            Assertion.addMethod('accessible', function(config) {
                var deferred = $.Deferred();
                // fetch the element, Element here can be a DOM element, a jQuery element or a HTML String. So, we wrap it in a
        Severity: Minor
        Found in lib/browser.js - About 1 hr to fix

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

          module.exports = function chaiAccessibility(chai) {
              var Assertion = chai.Assertion;
              Assertion.addMethod('accessible', function(config) {
                  // extract the DOM element which will be a string in this case
                  var element = this._obj;
          Severity: Minor
          Found in lib/node.js - About 1 hr to fix

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

                            files: [
                                {
                                    src: [
                                        'node_modules/requirejs/require.js',
                                        'test/require-config.js'
            Severity: Minor
            Found in Gruntfile.js and 1 other location - About 40 mins to fix
            Gruntfile.js on lines 85..104

            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

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

                            files: [
                                {
                                    src: [
                                        'node_modules/requirejs/require.js',
                                        'test/require-config.js'
            Severity: Minor
            Found in Gruntfile.js and 1 other location - About 40 mins to fix
            Gruntfile.js on lines 119..138

            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

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

                            config.ignore.forEach(function(ignores) {
                                configuration.ignoreSelectors(ignores[0], ignores[1] || '*');
                            });
            Severity: Minor
            Found in lib/index.js and 1 other location - About 30 mins to fix
            lib/browser.js on lines 48..50

            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

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

                        config.ignore.forEach(function(ignores) {
                            configuration.ignoreSelectors(ignores[0], ignores[1] || '*');
                        });
            Severity: Minor
            Found in lib/browser.js and 1 other location - About 30 mins to fix
            lib/index.js on lines 100..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 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

            Severity
            Category
            Status
            Source
            Language