meteor/meteor

View on GitHub
tools/packaging/package-client.js

Summary

Maintainability
F
6 days
Test Coverage

File package-client.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var _ = require('underscore');

var config = require('../meteor-services/config.js');
var httpHelpers = require('../utils/http-helpers.js');
var release = require('./release.js');
Severity: Major
Found in tools/packaging/package-client.js - About 1 day to fix

    Function publishPackage has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.publishPackage = function (options) {
      buildmessage.assertInJob();
      var packageSource = options.packageSource;
      var conn = options.connection;
      var projectContext = options.projectContext;
    Severity: Minor
    Found in tools/packaging/package-client.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 publishPackage has 216 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.publishPackage = function (options) {
      buildmessage.assertInJob();
      var packageSource = options.packageSource;
      var conn = options.connection;
      var projectContext = options.projectContext;
    Severity: Major
    Found in tools/packaging/package-client.js - About 1 day to fix

      Function _updateServerPackageData has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      var _updateServerPackageData = function (dataStore, options) {
        var self = this;
        options = options || {};
        if (dataStore === null) {
          throw Error("Data store expected");
      Severity: Minor
      Found in tools/packaging/package-client.js - About 3 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 _updateServerPackageData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var _updateServerPackageData = function (dataStore, options) {
        var self = this;
        options = options || {};
        if (dataStore === null) {
          throw Error("Data store expected");
      Severity: Major
      Found in tools/packaging/package-client.js - About 2 hrs to fix

        Function updatePackageMetadata has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.updatePackageMetadata = function (options) {
          buildmessage.assertInJob();
        
          var packageSource = options.packageSource;
          var conn = options.connection;
        Severity: Major
        Found in tools/packaging/package-client.js - About 2 hrs to fix

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

            var getSomeData = function () {
              var syncToken = dataStore.getSyncToken() || {format: "1.1"};
          
              if (!start) {
                start = {};
          Severity: Minor
          Found in tools/packaging/package-client.js - About 1 hr to fix

            Function bundleSource has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var bundleSource = function (isopack, includeSources, packageDir) {
              buildmessage.assertInJob();
            
              var name = isopack.name;
            
            
            Severity: Minor
            Found in tools/packaging/package-client.js - About 1 hr to fix

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

              var publishBuiltPackage = function (conn, isopack, bundleResult) {
                buildmessage.assertInJob();
                var name = isopack.name;
              
                var uploadInfo;
              Severity: Minor
              Found in tools/packaging/package-client.js - About 1 hr to fix

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

                exports.updatePackageMetadata = function (options) {
                  buildmessage.assertInJob();
                
                  var packageSource = options.packageSource;
                  var conn = options.connection;
                Severity: Minor
                Found in tools/packaging/package-client.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

                Avoid too many return statements within this function.
                Open

                    return;
                Severity: Major
                Found in tools/packaging/package-client.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return;
                  Severity: Major
                  Found in tools/packaging/package-client.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return;
                    Severity: Major
                    Found in tools/packaging/package-client.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return;
                      Severity: Major
                      Found in tools/packaging/package-client.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return;
                        Severity: Major
                        Found in tools/packaging/package-client.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return;
                          Severity: Major
                          Found in tools/packaging/package-client.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return;
                            Severity: Major
                            Found in tools/packaging/package-client.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return;
                              Severity: Major
                              Found in tools/packaging/package-client.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return;
                                Severity: Major
                                Found in tools/packaging/package-client.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return;
                                  Severity: Major
                                  Found in tools/packaging/package-client.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return;
                                    Severity: Major
                                    Found in tools/packaging/package-client.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return;
                                      Severity: Major
                                      Found in tools/packaging/package-client.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                          return;
                                        Severity: Major
                                        Found in tools/packaging/package-client.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                              return;
                                          Severity: Major
                                          Found in tools/packaging/package-client.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                  return;
                                            Severity: Major
                                            Found in tools/packaging/package-client.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                  return;
                                              Severity: Major
                                              Found in tools/packaging/package-client.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                      return;
                                                Severity: Major
                                                Found in tools/packaging/package-client.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                        return;
                                                  Severity: Major
                                                  Found in tools/packaging/package-client.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                          return;
                                                    Severity: Major
                                                    Found in tools/packaging/package-client.js - About 30 mins to fix

                                                      There are no issues that match your filters.

                                                      Category
                                                      Status