zodern/meteor-up

View on GitHub

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

    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

      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

                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

                    Function status has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export async function status(api) {
                      const config = api.getConfig();
                      const lines = [];
                      let overallColor = 'green';
                    
                    
                    Severity: Major
                    Found in src/plugins/proxy/command-handlers.js - About 2 hrs to fix

                      File utils.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { Client } from 'ssh2-classic';
                      import debug from 'debug';
                      import expandTilde from 'expand-tilde';
                      import fs from 'fs';
                      import net from 'net';
                      Severity: Minor
                      Found in src/utils.js - About 2 hrs to fix

                        Function getInformation has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function getInformation(server, appName, api) {
                          return api.runSSHCommand(server, `sudo docker inspect ${appName} --format "{{json .}}"`)
                            // eslint-disable-next-line complexity
                            .then(({ host, output }) => {
                              let info;
                        Severity: Major
                        Found in src/plugins/meteor/status.js - About 2 hrs to fix

                          Function reconfigShared has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function reconfigShared(api) {
                            const config = api.getConfig().proxy;
                            const shared = config.shared || {};
                          
                            if (!config) {
                          Severity: Major
                          Found in src/plugins/proxy/command-handlers.js - About 2 hrs to fix

                            Function status has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function status has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

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

                                import { checkVersion, shouldShowDockerWarning } from './utils';
                                import {
                                  curry,
                                  difference,
                                  intersection
                                Severity: Minor
                                Found in src/plugins/docker/command-handlers.js - About 2 hrs to fix

                                  Function scrubConfig has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function scrubConfig(config, { scrubUrl }) {
                                    if (!config.proxy) {
                                      return config;
                                    }
                                  
                                  
                                  Severity: Minor
                                  Found in src/plugins/proxy/index.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

                                  Function prepareBundle has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export async function prepareBundle(api) {
                                    log('exec => mup meteor prepare-bundle');
                                    const {
                                      app: appConfig,
                                      privateDockerRegistry
                                  Severity: Major
                                  Found in src/plugins/meteor/command-handlers.js - About 2 hrs to fix

                                    Function _loadSessions has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      _loadSessions() {
                                        const config = this.getConfig();
                                    
                                        this.sessions = {};
                                    
                                    
                                    Severity: Minor
                                    Found in src/plugin-api.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language