meteor/meteor

View on GitHub

Showing 2,031 of 3,395 total issues

Function load has 169 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  load(bindings) {
    var self = this;
    var ret = new PackageRegistry();

    // XXX This is mostly duplicated from
Severity: Major
Found in tools/isobuild/bundler.js - About 6 hrs to fix

    Function request has 169 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      request: function (urlOrOptions, callback) {
        var options;
        if (!_.isObject(urlOrOptions)) {
          options = { url: urlOrOptions };
        } else {
    Severity: Major
    Found in tools/utils/http-helpers.js - About 6 hrs to fix

      Function priceVersions has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

      CS.VersionPricer.prototype.priceVersions = function (versions, mode, options) {
        var self = this;
      
        var getMajorMinorPatch = function (v) {
          var vInfo = self.getVersionInfo(v);
      Severity: Minor
      Found in packages/constraint-solver/version-pricer.js - About 6 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

      File buildmessage.js has 446 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var _ = require('underscore');
      var files = require('../fs/files');
      var parseStack = require('./parse-stack');
      var fiberHelpers = require('./fiber-helpers.js');
      var Progress = require('../console/progress').Progress;
      Severity: Minor
      Found in tools/utils/buildmessage.js - About 6 hrs to fix

        Function makeCompileStep has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.makeCompileStep = function (sourceItem, file, inputSourceArch, options) {
          var resources = options.resources;
          var addAsset = options.addAsset;
        
          var relPath = sourceItem.relPath;
        Severity: Minor
        Found in tools/isobuild/compiler-deprecated-compile-step.js - About 6 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 _emitResources has 161 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _emitResources(sourceBatches, onJsOutputFiles = () => {}) {
            buildmessage.assertInJob();
        
            const isWeb = archinfo.matches(this.arch, 'web');
            const isOs = archinfo.matches(this.arch, 'os');
        Severity: Major
        Found in tools/isobuild/bundler.js - About 6 hrs to fix

          Function computeJsOutputFilesMap has 160 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static computeJsOutputFilesMap(sourceBatches) {
              const map = new Map;
          
              sourceBatches.forEach(batch => {
                const name = batch.unibuild.pkg.name || null;
          Severity: Major
          Found in tools/isobuild/compiler-plugin.js - About 6 hrs to fix

            Function patch_splitMax has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

            diff_match_patch.prototype.patch_splitMax = function(patches) {
              var patch_size = this.Match_MaxBits;
              for (var x = 0; x < patches.length; x++) {
                if (patches[x].length1 <= patch_size) {
                  continue;
            Severity: Minor
            Found in packages/test-in-browser/diff_match_patch_uncompressed.js - About 6 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 makeCompileStep has 154 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.makeCompileStep = function (sourceItem, file, inputSourceArch, options) {
              var resources = options.resources;
              var addAsset = options.addAsset;
            
              var relPath = sourceItem.relPath;
            Severity: Major
            Found in tools/isobuild/compiler-deprecated-compile-step.js - About 6 hrs to fix

              Function loadServerBundles has 153 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var loadServerBundles = Profile("Load server bundles", function () {
                var infos = [];
              
                serverJson.load.forEach(function (fileInfo) {
                  var code = fs.readFileSync(path.resolve(serverDir, fileInfo.path));
              Severity: Major
              Found in tools/static-assets/server/boot.js - About 6 hrs to fix

                File driver.js has 421 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                ////
                //// Setup
                ////
                import { diff_match_patch } from './diff_match_patch_uncompressed'
                import 'bootstrap/dist/css/bootstrap.min.css';
                Severity: Minor
                Found in packages/test-in-browser/driver.js - About 6 hrs to fix

                  Function notNeeded has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                      FastClick.notNeeded = function(layer) {
                          var metaViewport;
                          var chromeVersion;
                          var blackberryVersion;
                          var firefoxVersion;
                  Severity: Minor
                  Found in packages/deprecated/fastclick/fastclick.js - About 6 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 maybeUpdateRelease has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var maybeUpdateRelease = function (options) {
                    // We are only updating packages, so we are not updating the release.
                    if (options["packages-only"]) {
                       return 0;
                    }
                  Severity: Minor
                  Found in tools/cli/commands-packages.js - About 6 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

                  File accounts_client.js has 418 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {AccountsCommon} from "./accounts_common.js";
                  
                  /**
                   * @summary Constructor for the `Accounts` object on the client.
                   * @locus Client
                  Severity: Minor
                  Found in packages/accounts-base/accounts_client.js - About 6 hrs to fix

                    File package-version-parser-tests.js has 416 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    var currentTest = null;
                    
                    Tinytest.add("package-version-parser - validatePackageName", function (test) {
                      var badName = function (packageName, messageExpect) {
                        test.throws(function () {
                    Severity: Minor
                    Found in packages/package-version-parser/package-version-parser-tests.js - About 6 hrs to fix

                      Function minMaxWS has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var minMaxWS = function (solver, solution, costTerms, costWeights, options,
                                               isMin) {
                        var curSolution = solution;
                        var curCost = curSolution.getWeightedSum(costTerms, costWeights);
                      
                      
                      Severity: Minor
                      Found in packages/logic-solver/optimize.js - About 5 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 call has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                      HTTP.call = function(method, url, options, callback) {
                      
                        ////////// Process arguments //////////
                      
                        if (! callback && typeof options === "function") {
                      Severity: Minor
                      Found in packages/deprecated/http/httpcall_client.js - About 5 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 diff_cleanupSemanticLossless has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                      diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
                        /**
                         * Given two strings, compute a score representing whether the internal
                         * boundary falls on logical boundaries.
                         * Scores range from 6 (best) to 0 (worst).
                      Severity: Minor
                      Found in packages/test-in-browser/diff_match_patch_uncompressed.js - About 5 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 runTest has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                        static runTest(testList, test, testRunner, options = {}) {
                          options.retries = options.retries || 0;
                      
                          let failure = null;
                          let startTime;
                      Severity: Minor
                      Found in tools/tool-testing/run.js - About 5 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 treemap has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        d3.layout.treemap = function() {
                          var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
                          function scale(children, k) {
                            var i = -1, n = children.length, child, area;
                            while (++i < n) {
                      Severity: Major
                      Found in packages/deprecated/d3/d3.v3.js - About 5 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language