meteor/meteor

View on GitHub

Showing 2,031 of 3,395 total issues

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

    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

      File tracker_tests.js has 592 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Tinytest.add('tracker - run', function (test) {
        var d = new Tracker.Dependency;
        var x = 0;
        var handle = Tracker.autorun(function (handle) {
          d.depend();
      Severity: Major
      Found in packages/tracker/tracker_tests.js - About 1 day to fix

        File watch.ts has 590 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Stats, BigIntStats, FSWatcher, Dirent } from "fs";
        import * as files from "./files";
        import * as safeWatcher from "./safe-watcher";
        import { createHash } from "crypto";
        import { coalesce } from "../utils/func-utils";
        Severity: Major
        Found in tools/fs/watch.ts - About 1 day to fix

          Function converter has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
          Open

          Showdown.converter = function(converter_options) {
          
          //
          // Globals:
          //
          Severity: Minor
          Found in packages/deprecated/markdown/showdown.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 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 _cmp has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
            Open

              _cmp(a, b) {
                if (a === undefined) {
                  return b === undefined ? 0 : -1;
                }
            
            
            Severity: Minor
            Found in packages/minimongo/matcher.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 collection.js has 579 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // options.connection, if given, is a LivedataClient or LivedataServer
            // XXX presently there is no way to destroy/clean up a Collection
            import {
              ASYNC_COLLECTION_METHODS,
              getAsyncMethodName,
            Severity: Major
            Found in packages/mongo/collection.js - About 1 day to fix

              File builder.js has 574 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import assert from "assert";
              import {WatchSet, readAndWatchFile, sha1} from '../fs/watch';
              import files, {
                symlinkWithOverwrite, realpath,
              } from '../fs/files';
              Severity: Major
              Found in tools/isobuild/builder.js - About 1 day to fix

                Function findModTarget has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                Open

                function findModTarget(doc, keyparts, options = {}) {
                  let usedArrayIndex = false;
                
                  for (let i = 0; i < keyparts.length; i++) {
                    const last = i === keyparts.length - 1;
                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

                Function _maybeSetUpReplication has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                Open

                  _maybeSetUpReplication(name, { _suppressSameNameError = false }) {
                    const self = this;
                    if (!(self._connection && self._connection.registerStore)) {
                      return;
                    }
                Severity: Minor
                Found in packages/mongo/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

                Function initHtml4 has 232 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    History.initHtml4 = function(){
                        // Initialise
                        if ( typeof History.initHtml4.initialized !== 'undefined' ) {
                            // Already Loaded
                            return false;
                Severity: Major
                Found in packages/deprecated/jquery-history/history.html4.js - About 1 day to fix

                  File tinytest.js has 542 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import isEqual from "lodash.isequal";
                  
                  /******************************************************************************/
                  /* TestCaseResults                                                            */
                  /******************************************************************************/
                  Severity: Major
                  Found in packages/tinytest/tinytest.js - About 1 day to fix

                    File builder.js has 537 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import _ from 'underscore';
                    import url from 'url';
                    import { Console } from '../console/console.js';
                    import buildmessage from '../utils/buildmessage.js';
                    import files from '../fs/files';
                    Severity: Major
                    Found in tools/cordova/builder.js - About 1 day to fix

                      Function _getAnswer has 220 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      CS.Solver.prototype._getAnswer = function (options) {
                        var self = this;
                        var input = self.input;
                        var analysis = self.analysis;
                        var cache = input.catalogCache;
                      Severity: Major
                      Found in packages/constraint-solver/solver.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 _retrySubscription has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Autoupdate._retrySubscription = () => {
                            Meteor.subscribe("meteor_autoupdate_clientVersions", {
                              onError(error) {
                                Meteor._debug("autoupdate subscription failed", error);
                                failures++;
                          Severity: Minor
                          Found in packages/autoupdate/autoupdate_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 brush has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            d3.svg.brush = function() {
                              var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, resizes = d3_svg_brushResizes[0], extent = [ [ 0, 0 ], [ 0, 0 ] ], extentDomain;
                              function brush(g) {
                                g.each(function() {
                                  var g = d3.select(this), bg = g.selectAll(".background").data([ 0 ]), fg = g.selectAll(".extent").data([ 0 ]), tz = g.selectAll(".resize").data(resizes, String), e;
                          Severity: Major
                          Found in packages/deprecated/d3/d3.v3.js - About 1 day to fix

                            Function diff_bisect_ has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                            Open

                            diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {
                              // Cache the text lengths to prevent multiple calls.
                              var text1_length = text1.length;
                              var text2_length = text2.length;
                              var max_d = Math.ceil((text1_length + text2_length) / 2);
                            Severity: Minor
                            Found in packages/test-in-browser/diff_match_patch_uncompressed.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