meteor/meteor

View on GitHub

Showing 3,395 of 3,395 total issues

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

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

                  History.replaceState = function(data,title,url,queue){
                      //History.debug('History.replaceState: called', arguments);
      
                      // Check the State
                      if ( History.getHashByUrl(url) && History.emulated.pushState ) {
      Severity: Major
      Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 day to fix
      packages/deprecated/jquery-history/history.js on lines 1698..1744

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

      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

                  History.pushState = function(data,title,url,queue){
                      //History.debug('History.pushState: called', arguments);
      
                      // Check the State
                      if ( History.getHashByUrl(url) && History.emulated.pushState ) {
      Severity: Major
      Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 day to fix
      packages/deprecated/jquery-history/history.js on lines 1755..1801

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

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

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

              groupTestNames.forEach((names, i) => {
                const escapedNames = names.map(
                  name => name.replace(/['"-\/\\^$*+?.()|[\]{}]/g, '\\$&')
                );
                
              Severity: Major
              Found in scripts/test-balancer/index.js and 1 other location - About 1 day to fix
              npm-packages/eslint-plugin-meteor/scripts/test-balancer/index.js on lines 93..125

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

              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

              groupTestNames.forEach((names, i) => {
                const escapedNames = names.map(
                  name => name.replace(/['"-\/\\^$*+?.()|[\]{}]/g, '\\$&')
                );
                
              scripts/test-balancer/index.js on lines 93..125

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

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

                    Function d3_geom_voronoiTessellate has 268 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function d3_geom_voronoiTessellate(points, callback) {
                        var Sites = {
                          list: points.map(function(v, i) {
                            return {
                              index: i,
                    Severity: Major
                    Found in packages/deprecated/d3/d3.v3.js - About 1 day to fix

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

                        d3.max = function(array, f) {
                          var i = -1, n = array.length, a, b;
                          if (arguments.length === 1) {
                            while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
                            while (++i < n) if ((b = array[i]) != null && b > a) a = b;
                      Severity: Major
                      Found in packages/deprecated/d3/d3.v3.js and 1 other location - About 1 day to fix
                      packages/deprecated/d3/d3.v3.js on lines 23..33

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

                      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

                        d3.min = function(array, f) {
                          var i = -1, n = array.length, a, b;
                          if (arguments.length === 1) {
                            while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
                            while (++i < n) if ((b = array[i]) != null && a > b) a = b;
                      Severity: Major
                      Found in packages/deprecated/d3/d3.v3.js and 1 other location - About 1 day to fix
                      packages/deprecated/d3/d3.v3.js on lines 34..44

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

                      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 password_server.js has 595 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { hash as bcryptHash, compare as bcryptCompare } from 'bcrypt';
                      import { Accounts } from "meteor/accounts-base";
                      
                      // Utility for grabbing user
                      const getUserById = (id, options) => Meteor.users.findOne(id, Accounts._addDefaultFieldSelector(options));
                      Severity: Major
                      Found in packages/accounts-password/password_server.js - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language