zodern/meteor-up

View on GitHub

Showing 160 of 160 total issues

File command-handlers.js has 534 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  addStartAppTask,
  checkAppStarted,
  createEnv,
  createServiceConfig,
Severity: Major
Found in src/plugins/meteor/command-handlers.js - About 1 day to fix

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

        }, (err, stream) => {
          if (err) {
            throw err;
          }
    
    
    Severity: Major
    Found in src/plugins/mongo/command-handlers.js and 1 other location - About 1 day to fix
    src/plugins/default/command-handlers.js on lines 77..96

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

    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

        conn.shell((err, stream) => {
          if (err) {
            throw err;
          }
          stream.on('close', () => {
    Severity: Major
    Found in src/plugins/default/command-handlers.js and 1 other location - About 1 day to fix
    src/plugins/mongo/command-handlers.js on lines 121..141

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

    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

      describe('stop', () => {
        it('should stop meteor app on "meteor" vm', async () => {
          const serverInfo = servers.mymeteor;
          sh.cd(path.resolve(os.tmpdir(), 'tests/project-1'));
          sh.exec('mup setup  && mup deploy --cached-build');
    Severity: Major
    Found in src/plugins/default/__tests__/index.js and 1 other location - About 7 hrs to fix
    src/plugins/mongo/__tests__/index.js on lines 81..97

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

    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

      describe('stop', () => {
        it('should stop mongodb on "mongo" vm', async () => {
          const serverInfo = servers.mymongo;
    
          sh.cd(path.resolve(os.tmpdir(), 'tests/project-1'));
    Severity: Major
    Found in src/plugins/mongo/__tests__/index.js and 1 other location - About 7 hrs to fix
    src/plugins/default/__tests__/index.js on lines 188..204

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

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

    import * as swarmUtils from './swarm-utils';
    import * as tasks from './tasks';
    import * as utils from './utils';
    import configValidator, { showDepreciations, showErrors } from './validate/index';
    import { hooks, runRemoteHooks } from './hooks';
    Severity: Minor
    Found in src/plugin-api.js - About 6 hrs to fix

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

        describe('start', () => {
          const serverInfo = servers.mymeteor;
      
          it('should start meteor on "meteor" vm', async () => {
            sh.cd(path.resolve(os.tmpdir(), 'tests/project-1'));
      Severity: Major
      Found in src/plugins/meteor/__tests__/index.js and 1 other location - About 6 hrs to fix
      src/plugins/meteor/__tests__/index.js on lines 282..300

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

      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

        describe('stop', () => {
          const serverInfo = servers.mymeteor;
          it('should stop meteor app on "meteor" vm', async () => {
            sh.cd(path.resolve(os.tmpdir(), 'tests/project-1'));
      
      
      Severity: Major
      Found in src/plugins/meteor/__tests__/index.js and 1 other location - About 6 hrs to fix
      src/plugins/meteor/__tests__/index.js on lines 139..160

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

      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

      export function showErrors(errors) {
        const lines = [];
        const plural = errors.length > 1 ? 's' : '';
      
        lines.push(`${errors.length} Validation Error${plural}`);
      Severity: Major
      Found in src/validate/index.js and 1 other location - About 5 hrs to fix
      src/validate/index.js on lines 97..110

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

      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

      export function showDepreciations(depreciations) {
        const lines = [];
        const plural = depreciations.length > 1 ? 's' : '';
      
        lines.push(`${depreciations.length} Depreciation${plural}`);
      Severity: Major
      Found in src/validate/index.js and 1 other location - About 5 hrs to fix
      src/validate/index.js on lines 82..95

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

      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 setup has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function setup(api) {
        log('exec => mup proxy setup');
        const config = api.getConfig().proxy;
        const serverConfig = api.getConfig().servers;
        const appConfig = api.getConfig().app;
      Severity: Major
      Found in src/plugins/proxy/command-handlers.js - About 4 hrs to fix

        File command-handlers.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { addProxyEnv, getLoadBalancingHosts, getSessions } from './utils';
        import chalk from 'chalk';
        import { clone } from 'lodash';
        import debug from 'debug';
        import fs from 'fs';
        Severity: Minor
        Found in src/plugins/proxy/command-handlers.js - About 4 hrs to fix

          Function envconfig has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function envconfig(api) {
            log('exec => mup meteor envconfig');
            const {
              servers,
              app,
          Severity: Major
          Found in src/plugins/meteor/command-handlers.js - About 4 hrs to fix

            PluginAPI has 31 functions (exceeds 20 allowed). Consider refactoring.
            Open

            export default class PluginAPI {
              constructor(base, filteredArgs, program) {
                this.base = program.config ? path.dirname(program.config) : base;
                this.args = filteredArgs;
                this._origionalConfig = null;
            Severity: Minor
            Found in src/plugin-api.js - About 3 hrs to fix

              Function prepareBundleLocally has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export async function prepareBundleLocally(
                buildLocation, bundlePath, api
              ) {
                const {
                  app: appConfig,
              Severity: Major
              Found in src/plugins/meteor/prepare-bundle.js - About 3 hrs to fix

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

                  _runPostHooks = async function(commandName) {
                    const hookName = `post.${commandName}`;
                
                    if (this.program['show-hook-names']) {
                      console.log(chalk.yellow(`Hook: ${hookName}`));
                Severity: Major
                Found in src/plugin-api.js and 1 other location - About 3 hrs to fix
                src/plugin-api.js on lines 273..285

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

                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

                  _runPreHooks = async function(name) {
                    const hookName = `pre.${name}`;
                
                    if (this.program['show-hook-names']) {
                      console.log(chalk.yellow(`Hook: ${hookName}`));
                Severity: Major
                Found in src/plugin-api.js and 1 other location - About 3 hrs to fix
                src/plugin-api.js on lines 286..298

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

                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 setupSwarm has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export async function setupSwarm(api) {
                  const config = api.getConfig();
                
                  if (!api.swarmEnabled()) {
                    return;
                Severity: Major
                Found in src/plugins/docker/command-handlers.js - About 3 hrs to fix

                  Function debugApp has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export async function debugApp(api) {
                    const {
                      servers,
                      app
                    } = api.getConfig();
                  Severity: Major
                  Found in src/plugins/meteor/command-handlers.js - About 3 hrs to fix

                    Function _loadSessions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _loadSessions() {
                        const config = this.getConfig();
                    
                        this.sessions = {};
                    
                    
                    Severity: Minor
                    Found in src/plugin-api.js - About 2 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

                    Severity
                    Category
                    Status
                    Source
                    Language