betajs/betajs-compile

View on GitHub

Showing 25 of 25 total issues

Function browserstack has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
Open

var browserstack = function (compatability, desktop, mobile, flash) {
    var result = [];
    for (var key in compatability) {
        var value = compatability[key].toLowerCase();
        var versions = value.replace(/\s/g, '').split("-");
Severity: Minor
Found in grunt/browserstack.js - About 1 day 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 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (taskname, options) {
    this.grunt.loadNpmTasks('grunt-template');
    this.grunt.loadNpmTasks('grunt-jsdoc');
    this.grunt.loadNpmTasks('grunt-contrib-clean');
    taskname = taskname || "docs";
Severity: Major
Found in grunt/docs.js - About 3 hrs to fix

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

            this.addConfigTask("template", taskname + "-temp-builds", {
                options : {
                    data: {
                        indent: "",
                        framework: this.pkg,
    Severity: Major
    Found in grunt/docs.js and 1 other location - About 3 hrs to fix
    grunt/docs.js on lines 8..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 98.

    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

            this.addConfigTask("template", taskname + "-temp-about", {
                options : {
                    data: {
                        indent: "",
                        framework: this.pkg,
    Severity: Major
    Found in grunt/docs.js and 1 other location - About 3 hrs to fix
    grunt/docs.js on lines 20..31

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

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

    var browserstack = function (compatability, desktop, mobile, flash) {
        var result = [];
        for (var key in compatability) {
            var value = compatability[key].toLowerCase();
            var versions = value.replace(/\s/g, '').split("-");
    Severity: Major
    Found in grunt/browserstack.js - About 2 hrs to fix

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

      module.exports = function (taskname, source, target, template, encode) {
          this.grunt.loadNpmTasks('grunt-contrib-concat');
          this.grunt.loadNpmTasks('grunt-yaml');
          this.grunt.loadNpmTasks('grunt-template');
          this.grunt.loadNpmTasks('grunt-contrib-clean');
      Severity: Minor
      Found in grunt/yamltojs.js - About 2 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 exports has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (taskname, source, target, template, encode) {
          this.grunt.loadNpmTasks('grunt-contrib-concat');
          this.grunt.loadNpmTasks('grunt-yaml');
          this.grunt.loadNpmTasks('grunt-template');
          this.grunt.loadNpmTasks('grunt-contrib-clean');
      Severity: Major
      Found in grunt/yamltojs.js - About 2 hrs to fix

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

        module.exports = function (taskname, source, target, options) {
            this.grunt.loadNpmTasks('grunt-contrib-concat');
            this.grunt.loadNpmTasks('grunt-dart-sass');
            this.grunt.loadNpmTasks('grunt-contrib-clean');
            taskname = taskname || "concatsass";
        Severity: Minor
        Found in grunt/concatsass.js - About 1 hr to fix

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

          module.exports = function (taskname, test, httpserver, ngrok) {
              taskname = taskname || "browserqunit";
              if (httpserver) {
                  this.grunt.loadNpmTasks('grunt-contrib-connect');
                  if (ngrok) {
          Severity: Minor
          Found in grunt/browserqunit.js - About 1 hr to fix

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

            module.exports = function (taskname, tests, options) {
                this.grunt.loadNpmTasks('grunt-template');
                this.grunt.loadNpmTasks('grunt-shell');
                this.grunt.loadNpmTasks('grunt-contrib-clean');
                options = options || {};
            Severity: Minor
            Found in grunt/browserstack.js - About 1 hr to fix

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

              module.exports = function (taskname, src, dest, targetplayer, targetswf) {
                  this.grunt.loadNpmTasks('grunt-shell');
                  taskname = taskname || "flash";
                  targetplayer = targetplayer || "11.2";
                  src = src.split("/");
              Severity: Minor
              Found in grunt/flash.js - About 1 hr to fix

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

                module.exports = function (taskname, options) {
                    taskname = taskname || "package";
                    var _ = require("lodash");
                    var grunt = this.grunt;
                    return this.registerTask(taskname, function () {
                Severity: Minor
                Found in grunt/package.js - About 1 hr to fix

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

                  module.exports = function (taskname, files) {
                      this.grunt.loadNpmTasks('grunt-contrib-copy');
                      taskname = taskname || "simplecopy";
                      var mapped = [];
                      var process = function (target, source) {
                  Severity: Minor
                  Found in grunt/simplecopy.js - About 1 hr to fix

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

                    module.exports = function (taskname, source, target, bindings, version_assumptions, exports, process, options) {
                    Severity: Major
                    Found in grunt/scopedclosurerevision.js - About 1 hr to fix

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

                      module.exports = function (taskname, test, httpserver, ngrok) {
                          taskname = taskname || "browserqunit";
                          if (httpserver) {
                              this.grunt.loadNpmTasks('grunt-contrib-connect');
                              if (ngrok) {
                      Severity: Minor
                      Found in grunt/browserqunit.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

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

                                          summarydoc: this.pkg.meta.summarydoc ? this.grunt.file.read(this.pkg.meta.summarydoc) : null
                      Severity: Minor
                      Found in grunt/readme.js and 1 other location - About 50 mins to fix
                      grunt/readme.js on lines 10..10

                      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

                                          installdoc: this.pkg.meta.installdoc ? this.grunt.file.read(this.pkg.meta.installdoc) : null,
                      Severity: Minor
                      Found in grunt/readme.js and 1 other location - About 50 mins to fix
                      grunt/readme.js on lines 11..11

                      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

                      Avoid deeply nested control flow statements.
                      Open

                                          if (mapped.real_mobile && current in mapped.real_mobile)
                                              mob.real_mobile = mapped.real_mobile[current];
                      Severity: Major
                      Found in grunt/browserstack.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if (mapped.device_map && mapped.device_map[current])
                                                mob.device = mapped.device_map[current];
                        Severity: Major
                        Found in grunt/browserstack.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if (mapped.extend_map && mapped.extend_map[current])
                                                  result.push(mapped.extend_map[current]);
                                              else
                                                  result.push(name + "_" + current);
                          Severity: Major
                          Found in grunt/browserstack.js - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language