meteor/meteor

View on GitHub

Showing 2,031 of 3,395 total issues

File solver.js has 772 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const has = Npm.require('lodash.has');
const zip = Npm.require('lodash.zip');
const memoize = Npm.require('lodash.memoize');
const groupBy = Npm.require('lodash.groupby');

Severity: Major
Found in packages/constraint-solver/solver.js - About 1 day to fix

    File linker.js has 746 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var _ = require('underscore');
    var sourcemap = require('source-map');
    var buildmessage = require('../utils/buildmessage.js');
    var watch = require('../fs/watch');
    var Profile = require('../tool-env/profile').Profile;
    Severity: Major
    Found in tools/isobuild/linker.js - About 1 day to fix

      File run-mongo.js has 744 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { MongoExitCodes } from '../utils/mongo-exit-codes';
      var files = require('../fs/files');
      var utils = require('../utils/utils.js');
      var fiberHelpers = require('../utils/fiber-helpers.js');
      var runLog = require('./run-log.js');
      Severity: Major
      Found in tools/runners/run-mongo.js - About 1 day to fix

        File catalog-remote.js has 735 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var _ = require('underscore');
        var sqlite3 = require('sqlite3');
        
        var files = require('../../fs/files');
        var utils = require('../../utils/utils.js');
        Severity: Major
        Found in tools/packaging/catalog/catalog-remote.js - About 1 day to fix

          File allow_tests.js has 726 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          if (Meteor.isServer) {
            // Set up allow/deny rules for test collections
          
            var allowCollections = {};
          
          
          Severity: Major
          Found in packages/mongo/allow_tests.js - About 1 day to fix

            Function _runOnce has 334 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _runOnce: function (options) {
                var self = this;
                options = options || {};
                var firstRun = options.firstRun;
            
            
            Severity: Major
            Found in tools/runners/run-app.js - About 1 day to fix

              Function launchMongo has 313 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var launchMongo = function(options) {
                var onExit = options.onExit || function() {};
              
                var noOplog = false;
                var mongod_path = files.pathJoin(
              Severity: Major
              Found in tools/runners/run-mongo.js - About 1 day to fix

                File run-app.js has 684 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                var _ = require('underscore');
                var Fiber = require('fibers');
                var files = require('../fs/files');
                var watch = require('../fs/watch');
                var bundler = require('../isobuild/bundler.js');
                Severity: Major
                Found in tools/runners/run-app.js - About 1 day to fix

                  File auth.js has 683 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  var _ = require('underscore');
                  var utils = require('../utils/utils.js');
                  var files = require('../fs/files');
                  var config = require('./config.js');
                  var httpHelpers = require('../utils/http-helpers.js');
                  Severity: Major
                  Found in tools/meteor-services/auth.js - About 1 day to fix

                    File deploy.js has 678 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // URL parsing and validation
                    // RPC to server (endpoint, arguments)
                    // see if RPC requires password
                    // prompt for password
                    // send RPC with or without password as required
                    Severity: Major
                    Found in tools/meteor-services/deploy.js - About 1 day to fix

                      File input-tests.js has 669 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      var CS = ConstraintSolver;
                      
                      // "Input tests" are the new style of tests that operate by creating a
                      // CS.Input (representing a problem statement) and passing it into
                      // CS.PackagesResolver.
                      Severity: Major
                      Found in packages/constraint-solver/input-tests.js - About 1 day to fix

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

                          _runOnce: function (options) {
                            var self = this;
                            options = options || {};
                            var firstRun = options.firstRun;
                        
                        
                        Severity: Minor
                        Found in tools/runners/run-app.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

                        File match_test.js has 659 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        Tinytest.add('check - check', test => {
                          const matches = (value, pattern) => {
                            let error;
                            try {
                              check(value, pattern);
                        Severity: Major
                        Found in packages/check/match_test.js - About 1 day to fix

                          File project.js has 651 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import _ from 'underscore';
                          import util from 'util';
                          import assert from 'assert';
                          import chalk from 'chalk';
                          import semver from 'semver';
                          Severity: Major
                          Found in tools/cordova/project.js - About 1 day to fix

                            File amplify.js has 647 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*!
                             * Amplify 1.1.2
                             *
                             * Copyright 2011 - 2013 appendTo LLC. (http://appendto.com/team)
                             * Dual licensed under the MIT or GPL licenses.
                            Severity: Major
                            Found in packages/deprecated/amplify/amplify.js - About 1 day to fix

                              File oplog_observe_driver.js has 636 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { oplogV2V1Converter } from "./oplog_v2_converter";
                              
                              var Future = Npm.require('fibers/future');
                              
                              var PHASE = {
                              Severity: Major
                              Found in packages/mongo/oplog_observe_driver.js - About 1 day to fix

                                File accounts_tests.js has 636 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { Mongo } from 'meteor/mongo';
                                import { URL } from 'meteor/url';
                                import { Meteor } from 'meteor/meteor';
                                import { Accounts } from 'meteor/accounts-base';
                                import { Random } from 'meteor/random';
                                Severity: Major
                                Found in packages/accounts-base/accounts_tests.js - About 1 day to fix

                                  Function _observeFromObserveChanges has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  LocalCollection._observeFromObserveChanges = (cursor, observeCallbacks) => {
                                    const transform = cursor.getTransform() || (doc => doc);
                                    let suppressed = !!observeCallbacks._suppress_initial;
                                  
                                    let observeChangesCallbacks;
                                  Severity: Minor
                                  Found in packages/minimongo/local_collection.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

                                  File compiler.js has 630 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  var _ = require('underscore');
                                  
                                  var archinfo = require('../utils/archinfo');
                                  var buildmessage = require('../utils/buildmessage.js');
                                  var isopack = require('./isopack.js');
                                  Severity: Major
                                  Found in tools/isobuild/compiler.js - About 1 day to fix

                                    Function runWebAppServer has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function runWebAppServer() {
                                      var shuttingDown = false;
                                      var syncQueue = new Meteor._SynchronousQueue();
                                    
                                      var getItemPathname = function(itemUrl) {
                                    Severity: Minor
                                    Found in packages/webapp/webapp_server.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language