codeclimate/javascript-test-reporter

View on GitHub

Showing 14 of 28 total issues

Function getInfo has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getInfo: function() {
    var env = process.env;

    if (env.TRAVIS) {
      return {
Severity: Major
Found in ci_info.js - About 3 hrs to fix

    Function getInfo has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      getInfo: function() {
        var env = process.env;
    
        if (env.TRAVIS) {
          return {
    Severity: Minor
    Found in ci_info.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 sourceFiles has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Formatter.prototype.sourceFiles = function(data) {
      var source_files = [];
      var self = this;
      data.forEach(function(elem, index) {
        var content;
    Severity: Minor
    Found in formatter.js - About 1 hr to fix

      Function format has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Formatter.prototype.format = function(coverageData, callback) {
        var self = this;
      
        self.parse(coverageData, function(parseError, data) {
          if (parseError) {
      Severity: Minor
      Found in formatter.js - About 1 hr to fix

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

        module.exports = function(data, cb) {
          var memo = {};
          var parsedData = [];
        
          var lines = data.split('\n');
        Severity: Minor
        Found in gocover_parse.js - About 1 hr to fix

          Function postJson has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var postJson = function(data, opts) {
            opts = opts || {};
          
            options.rejectUnauthorized = !opts.skip_certificate;
          
          
          Severity: Minor
          Found in http_client.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                  return {};
            Severity: Major
            Found in ci_info.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return {
                      name:             "gitlab-ci",
                      build_identifier: env.CI_BUILD_ID,
                      branch:           env.CI_BUILD_REF_NAME,
                      commit_sha:       env.CI_BUILD_REF
              Severity: Major
              Found in ci_info.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return {
                        name:             "tddium",
                        build_identifier: env.TDDIUM_SESSION_ID,
                        worker_id:        env.TDDIUM_TID
                      };
                Severity: Major
                Found in ci_info.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return {
                          name:             "buildkite",
                          build_identifier: env.BUILDKITE_BUILD_ID,
                          build_url:        env.BUILDKITE_BUILD_URL,
                          branch:           env.BUILDKITE_BRANCH,
                  Severity: Major
                  Found in ci_info.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return {
                            name:             "codeship",
                            build_identifier: env.CI_BUILD_NUMBER,
                            build_url:        env.CI_BUILD_URL,
                            branch:           env.CI_BRANCH,
                    Severity: Major
                    Found in ci_info.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return {
                              name:             "appveyor",
                              build_identifier: env.APPVEYOR_BUILD_NUMBER,
                              branch:           env.APPVEYOR_REPO_BRANCH,
                              commit_sha:       env.APPVEYOR_REPO_COMMIT,
                      Severity: Major
                      Found in ci_info.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return {
                                name:               "wercker",
                                build_identifier:   env.WERCKER_BUILD_ID,
                                build_url:          env.WERCKER_BUILD_URL,
                                branch:             env.WERCKER_GIT_BRANCH,
                        Severity: Major
                        Found in ci_info.js - About 30 mins to fix

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

                            committedAt: function(cb) {
                              childProcess.exec("git log -1 --pretty=format:%ct", function (error, stdout, stderr) {
                                var result = null;
                                var timestamp = null;
                                if (stdout) {
                          Severity: Minor
                          Found in git_info.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