meteor/meteor

View on GitHub

Showing 3,362 of 3,362 total issues

File common.js has 861 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import LocalCollection from './local_collection.js';

export const hasOwn = Object.prototype.hasOwnProperty;

// Each element selector contains:
Severity: Major
Found in packages/minimongo/common.js - About 2 days to fix

    File backbone.js has 856 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    //     Backbone.js 0.9.2
    
    //     (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
    //     Backbone may be freely distributed under the MIT license.
    //     For all details and documentation:
    Severity: Major
    Found in packages/deprecated/backbone/backbone.js - About 2 days to fix

      File history.js has 848 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * History.js Core
       * @author Benjamin Arthur Lupton <contact@balupton.com>
       * @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
       * @license New BSD License <http://creativecommons.org/licenses/BSD/>
      Severity: Major
      Found in packages/deprecated/jquery-history/history.js - About 2 days to fix

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

          var args = splitArgs({
            'rails': '4.0.0',
            'protected-attributes': null,
            'rails-observers': null,
            'actionpack-page-caching': null,
        Severity: Major
        Found in packages/constraint-solver/benchmark-tests.js and 1 other location - About 2 days to fix
        packages/constraint-solver/benchmark-tests.js on lines 124..195

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

        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

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

          var args = splitArgs({
            'rails': '4.0.0',
            'protected-attributes': null,
            'rails-observers': null,
            'actionpack-page-caching': null,
        Severity: Major
        Found in packages/constraint-solver/benchmark-tests.js and 1 other location - About 2 days to fix
        packages/constraint-solver/benchmark-tests.js on lines 45..116

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

        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

        File console.js has 827 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        ///  This class provides a set of utility functions for printing to the terminal
        ///  in the Meteor tool.
        ///
        ///  When you intend for your messages to be read by humans, you should use the
        ///  following functions to print to the terminal. They will automatically line
        Severity: Major
        Found in tools/console/console.js - About 1 day to fix

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

          Tinytest.add("spiderable - is ready with a custom hook", function (test, expect) {
            var callbacks = {}
            test.equal(
              _.keys(Spiderable._onReadyHook.callbacks).length,
              2
          Severity: Major
          Found in packages/deprecated/spiderable/spiderable_client_tests.js and 1 other location - About 1 day to fix
          packages/deprecated/spiderable/spiderable_client_tests.js on lines 41..81

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

          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

          Tinytest.add("spiderable - is not ready with a custom hook", function (test, expect) {
            var callbacks = {}
            test.equal(
              _.keys(Spiderable._onReadyHook.callbacks).length,
              2
          Severity: Major
          Found in packages/deprecated/spiderable/spiderable_client_tests.js and 1 other location - About 1 day to fix
          packages/deprecated/spiderable/spiderable_client_tests.js on lines 83..123

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

          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

          File meteor-npm.js has 775 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /// Implements the process of managing a package's .npm directory,
          /// in which we call `npm install` to install npm dependencies,
          /// and a variety of related commands. Notably, we use `npm shrinkwrap`
          /// to ensure we get consistent versions of npm sub-dependencies.
          
          
          Severity: Major
          Found in tools/isobuild/meteor-npm.js - About 1 day to fix

            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 testSubtree has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const testSubtree = (value, pattern) => {
                        
                          // Match anything!
                          if (pattern === Match.Any) {
                            return false;
                        Severity: Minor
                        Found in packages/check/match.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 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
                                Severity
                                Category
                                Status
                                Source
                                Language