timbeadle/grunt-tv4

View on GitHub

Showing 17 of 17 total issues

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

module.exports = function (grunt) {
    // Load all npm grunt tasks
    require('load-grunt-tasks')(grunt);

    grunt.loadTasks('tasks');
Severity: Major
Found in Gruntfile.js - About 1 day to fix

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

    /*
     * Grunt wrapper for tv4 - grunt-tv4
     * https://github.com/timbeadle/grunt-tv4
     *
     * Copyright (c) 2013 Bart van der Schoor
    Severity: Minor
    Found in Gruntfile.js - About 5 hrs to fix

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

      module.exports = (grunt) => {
          const out = miniwrite.grunt(grunt);
          const style = ministyle.grunt();
          const report = reporter.getReporter(out, style);
          const runner = runnerModule.getRunner(
      Severity: Major
      Found in tasks/tv4.js - About 3 hrs to fix

        Function exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function (grunt) {
            // Load all npm grunt tasks
            require('load-grunt-tasks')(grunt);
        
            grunt.loadTasks('tasks');
        Severity: Minor
        Found in Gruntfile.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 loadHTTP has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const loadHTTP = (uri, options, callback) => {
            const options_ = {
                timeout: options ? options.timeout : 5000,
            };
        
        
        Severity: Minor
        Found in lib/loader.js - About 1 hr to fix

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

                          options: {
                              fresh: true,
                              root: grunt.file.readJSON('test/fixtures/bulk/schema/schema.json'),
                              add: [
                                  grunt.file.readJSON('test/fixtures/bulk/schema/alpha.json'),
          Severity: Major
          Found in Gruntfile.js and 1 other location - About 1 hr to fix
          Gruntfile.js on lines 273..280

          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

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

                          options: {
                              fresh: true,
                              root: grunt.file.readJSON('test/fixtures/bulk/schema/schema.json'),
                              add: [
                                  grunt.file.readJSON('test/fixtures/bulk/schema/alpha.json'),
          Severity: Major
          Found in Gruntfile.js and 1 other location - About 1 hr to fix
          Gruntfile.js on lines 231..238

          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

                  grunt.util._.each(context.options.schemas, (schema, uri) => {
                      context.tv4.addSchema(uri, schema);
                  });
          Severity: Minor
          Found in tasks/tv4.js and 1 other location - About 50 mins to fix
          tasks/tv4.js on lines 49..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 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

                  grunt.util._.each(context.options.languages, (language, id) => {
                      context.tv4.addLanguage(id, language);
                  });
          Severity: Minor
          Found in tasks/tv4.js and 1 other location - About 50 mins to fix
          tasks/tv4.js on lines 43..45

          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 (name.startsWith('pass_')) {
                      passNames.push('tv4:' + name);
                      if (conf[name]._twice) {
                          passNames.push('tv4:' + name);
                      }
          Severity: Minor
          Found in Gruntfile.js and 1 other location - About 40 mins to fix
          Gruntfile.js on lines 389..396

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

          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 (name.startsWith('fail_')) {
                      failNames.push('tv4:' + name);
                      if (conf[name]._twice) {
                          failNames.push('tv4:' + name);
                      }
          Severity: Minor
          Found in Gruntfile.js and 1 other location - About 40 mins to fix
          Gruntfile.js on lines 384..396

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

          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

                          options: {
                              fresh: true,
                              root: 'test/fixtures/bulk/schema/schema.json',
                              add: [
                                  grunt.file.readJSON('test/fixtures/bulk/schema/alpha.json'),
          Severity: Minor
          Found in Gruntfile.js and 1 other location - About 40 mins to fix
          Gruntfile.js on lines 218..225

          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

                          options: {
                              fresh: true,
                              root: 'test/fixtures/bulk/schema/schema.json',
                              add: [
                                  grunt.file.readJSON('test/fixtures/bulk/schema/alpha.json'),
          Severity: Minor
          Found in Gruntfile.js and 1 other location - About 40 mins to fix
          Gruntfile.js on lines 204..211

          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

          TODO found
          Open

                          objects, // TODO rename objects to values
          Severity: Minor
          Found in lib/runner.js by fixme

          TODO found
          Open

                  // TODO verify reportOnMissing
          Severity: Minor
          Found in lib/runner.js by fixme

          TODO found
          Open

                      // TODO verify http:, file: and plain paths all load properly
          Severity: Minor
          Found in lib/runner.js by fixme

          TODO found
          Open

                      // TODO handle this better
          Severity: Minor
          Found in lib/runner.js by fixme
          Severity
          Category
          Status
          Source
          Language