meteor/meteor

View on GitHub

Showing 3,395 of 3,395 total issues

File minimongo_tests_server.js has 462 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Tinytest.add('minimongo - modifier affects selector', test => {
  function testSelectorPaths(sel, paths, desc) {
    const matcher = new Minimongo.Matcher(sel);
    test.equal(matcher._getPaths(), paths, desc);
  }
Severity: Minor
Found in packages/minimongo/minimongo_tests_server.js - About 7 hrs to fix

    Function bundleAndDeploy has 173 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export async function bundleAndDeploy(options) {
      if (options.recordPackageUsage === undefined) {
        options.recordPackageUsage = true;
      }
    
    
    Severity: Major
    Found in tools/meteor-services/deploy.js - About 6 hrs to fix

      Function startNewWatcher has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
      Open

      function startNewWatcher(absPath: string): Entry {
        let stat: Stats | BigIntStats | null | undefined = null;
      
        if (DEDUPLICATE_BY_INO) {
          stat = statOrNull(absPath);
      Severity: Minor
      Found in tools/fs/safe-watcher.ts - 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

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

        Tinytest.add(
          "passwords - enroll tokens don't get cleaned up when reset tokens are cleaned up",
          test => {
            const email = `${test.id}-intercept@example.com`;
            const userId = Accounts.createUser({email: email, password: hashPassword('password')});
      Severity: Major
      Found in packages/accounts-password/password_tests.js and 1 other location - About 6 hrs to fix
      packages/accounts-password/password_tests.js on lines 1512..1525

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

      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(
          "passwords - reset tokens don't get cleaned up when enroll tokens are cleaned up",
          test => {
            const email = `${test.id}-intercept@example.com`;
            const userId = Accounts.createUser({email: email, password: hashPassword('password')});
      Severity: Major
      Found in packages/accounts-password/password_tests.js and 1 other location - About 6 hrs to fix
      packages/accounts-password/password_tests.js on lines 1497..1510

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

      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

          graticule.minorExtent = function(_) {
            if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
            x0 = +_[0][0], x1 = +_[1][0];
            y0 = +_[0][1], y1 = +_[1][1];
            if (x0 > x1) _ = x0, x0 = x1, x1 = _;
      Severity: Major
      Found in packages/deprecated/d3/d3.v3.js and 1 other location - About 6 hrs to fix
      packages/deprecated/d3/d3.v3.js on lines 3106..3113

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

      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

          graticule.majorExtent = function(_) {
            if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];
            X0 = +_[0][0], X1 = +_[1][0];
            Y0 = +_[0][1], Y1 = +_[1][1];
            if (X0 > X1) _ = X0, X0 = X1, X1 = _;
      Severity: Major
      Found in packages/deprecated/d3/d3.v3.js and 1 other location - About 6 hrs to fix
      packages/deprecated/d3/d3.v3.js on lines 3114..3121

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

      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

      Function doTestCommand has 171 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function doTestCommand(options) {
        // This "metadata" is accessed in a few places. Using a global
        // variable here was more expedient than navigating the many layers
        // of abstraction across the build process.
        //
      Severity: Major
      Found in tools/cli/commands.js - About 6 hrs to fix

        Connection has 49 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class Connection {
          constructor(url, options) {
            const self = this;
        
            this.options = options = {
        Severity: Minor
        Found in packages/ddp-client/common/livedata_connection.js - About 6 hrs to fix

          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

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

                    _.each(convertedMetadata.plugins, function (pluginMeta) {
                      var programJsonPath = files.pathJoin(targetDirectory, pluginMeta.path);
                      var programJson = JSON.parse(files.readFile(programJsonPath));
              
                      if (programJson.format !== "javascript-image-pre1") {
              Severity: Major
              Found in tools/packaging/tropohouse.js and 1 other location - About 6 hrs to fix
              tools/packaging/tropohouse.js on lines 98..117

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

              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

                    _.each(convertedMetadata.builds, function (unibuildMeta) {
                      var unibuildJsonPath = files.pathJoin(targetDirectory,
                                                            unibuildMeta.path);
                      var unibuildJson = JSON.parse(files.readFile(unibuildJsonPath));
              
              
              Severity: Major
              Found in tools/packaging/tropohouse.js and 1 other location - About 6 hrs to fix
              tools/packaging/tropohouse.js on lines 120..138

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

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

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

                  Tinytest.add(
                    'passwords - reset tokens with reasons get cleaned up',
                    test => {
                      const email = `${test.id}-intercept@example.com`;
                      const userId = Accounts.createUser({email: email, password: hashPassword('password')});
                Severity: Major
                Found in packages/accounts-password/password_tests.js and 1 other location - About 6 hrs to fix
                packages/accounts-password/password_tests.js on lines 1487..1495

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

                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('passwords - enroll tokens get cleaned up', test => {
                    const email = `${test.id}-intercept@example.com`;
                    const userId = Accounts.createUser({email: email, password: hashPassword('password')});
                
                    Accounts.sendEnrollmentEmail(userId, email);
                Severity: Major
                Found in packages/accounts-password/password_tests.js and 1 other location - About 6 hrs to fix
                packages/accounts-password/password_tests.js on lines 1387..1398

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

                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

                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

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

                  depends(dependencies) {
                    // XXX make cordovaDependencies be separate between use and test, so that
                    // production doesn't have to ship all of the npm modules used by test
                    // code
                    if (this._dependencies) {
                Severity: Major
                Found in tools/isobuild/package-cordova.js and 1 other location - About 6 hrs to fix
                tools/isobuild/package-npm.js on lines 49..89

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

                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

                  depends(dependencies) {
                    // XXX make dependencies be separate between use and test, so that
                    // production doesn't have to ship all of the npm modules used by test
                    // code
                    if (this._dependencies) {
                Severity: Major
                Found in tools/isobuild/package-npm.js and 1 other location - About 6 hrs to fix
                tools/isobuild/package-cordova.js on lines 47..87

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

                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

                Severity
                Category
                Status
                Source
                Language