zodern/meteor-up

View on GitHub

Showing 160 of 160 total issues

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

export async function status(api) {
  const servers = Object.values(api.getConfig().servers || {});
  const lines = [];
  let overallColor = 'green';
  const command = 'lsb_release -r -s || echo "false"; lsb_release -is; apt-get -v &> /dev/null && echo "true" || echo "false"; echo $BASH';
Severity: Minor
Found in src/plugins/default/command-handlers.js - About 1 hr to fix

    Function setup has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function setup(api) {
      log('exec => mup meteor setup');
      const config = api.getConfig().app;
    
      if (!config) {
    Severity: Minor
    Found in src/plugins/meteor/command-handlers.js - About 1 hr to fix

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

        if (exposedPorts.length > 0) {
          const exposedSection = statusDisplay.addLine('Exposed Ports:');
          exposedPorts.forEach(port => {
            exposedSection.addLine(`- ${port}`);
          });
      Severity: Major
      Found in src/plugins/meteor/status.js and 1 other location - About 1 hr to fix
      src/plugins/meteor/status.js on lines 158..163

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

      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

        if (publishedPorts.length > 0) {
          const publishedSection = statusDisplay.addLine('Published Ports (Inside Container => On Server):');
          publishedPorts.forEach(port => {
            publishedSection.addLine(`- ${port}`);
          });
      Severity: Major
      Found in src/plugins/meteor/status.js and 1 other location - About 1 hr to fix
      src/plugins/meteor/status.js on lines 151..156

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

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

      export function ssh(api) {
        const servers = api.getConfig().servers;
        let serverOption = api.getArgs()[1];
      
        // Check how many sessions are enabled. Usually is all servers,
      Severity: Minor
      Found in src/plugins/default/command-handlers.js - About 1 hr to fix

        Function init has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function init(api) {
          const configSource = api.resolvePath(__dirname, 'template/mup.js.sample');
          const settingsSource = api.resolvePath(__dirname, 'template/settings.json');
        
          const { appPath, dest, createFolder } = findDestination(api);
        Severity: Minor
        Found in src/plugins/default/init.js - About 1 hr to fix

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

            if (typeof options.hostVars === 'object' && options.hostVars[session._host]) {
              options.vars = merge(options.vars, options.hostVars[session._host]);
            }
          Severity: Major
          Found in src/nodemiral.js and 1 other location - About 1 hr to fix
          src/nodemiral.js on lines 46..48

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

          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

            if (typeof options.hostVars === 'object' && options.hostVars[session._host]) {
              options.vars = merge(options.vars, options.hostVars[session._host]);
            }
          Severity: Major
          Found in src/nodemiral.js and 1 other location - About 1 hr to fix
          src/nodemiral.js on lines 8..10

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

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

          export async function status(api) {
            const config = api.getConfig();
            const {
              StatusDisplay
            } = api.statusHelpers;
          Severity: Minor
          Found in src/plugins/meteor/command-handlers.js - About 1 hr to fix

            Function setup has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function setup(api) {
              log('exec => mup mongo setup');
              const mongoConfig = api.getConfig().mongo;
            
              if (!mongoConfig) {
            Severity: Minor
            Found in src/plugins/mongo/command-handlers.js - About 1 hr to fix

              Function findDestination has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function findDestination(api) {
                const base = process.cwd();
              
                const inMeteorApp = fs.existsSync(api.resolvePath(base, '.meteor/release'));
                const parentMeteorApp = fs.existsSync(api.resolvePath(base, '../.meteor/release'));
              Severity: Minor
              Found in src/plugins/default/init.js - About 1 hr to fix

                Function buildApp has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function buildApp(appPath, buildOptions, verbose, api) {
                  // Check if the folder exists
                  try {
                    fs.statSync(api.resolvePath(appPath));
                  } catch (e) {
                Severity: Minor
                Found in src/plugins/meteor/build.js - About 1 hr to fix

                  Function destroy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export async function destroy(api) {
                    const config = api.getConfig();
                    const options = api.getOptions();
                  
                    if (!options.force) {
                  Severity: Minor
                  Found in src/plugins/meteor/command-handlers.js - About 1 hr to fix

                    Function push has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export async function push(api) {
                      log('exec => mup meteor push');
                    
                      await api.runCommand('meteor.build');
                      const {
                    Severity: Minor
                    Found in src/plugins/meteor/command-handlers.js - About 1 hr to fix

                      Function runSSHCommand has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function runSSHCommand(info, command) {
                        if (info instanceof nodemiral.session) {
                          return runSessionCommand(info, command);
                        }
                      
                      
                      Severity: Minor
                      Found in src/utils.js - About 1 hr to fix

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

                            it('should support shorter override format', () => {
                              function target() {}
                              commands['plugin.docker-setup'] = target;
                        
                              registerCommandOverrides('plugin', {
                        Severity: Major
                        Found in src/__tests__/commands.unit.js and 1 other location - About 1 hr to fix
                        src/__tests__/commands.unit.js on lines 29..36

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

                        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

                            it('should add override to list of commands', () => {
                              function target() {}
                              commands['plugin.docker-setup'] = target;
                              registerCommandOverrides('plugin', {
                                'docker.setup': 'plugin.docker-setup'
                        Severity: Major
                        Found in src/__tests__/commands.unit.js and 1 other location - About 1 hr to fix
                        src/__tests__/commands.unit.js on lines 37..45

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

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

                        function runSessionCommand(session, command) {
                          return new Promise((resolve, reject) => {
                            let client;
                            let done;
                        
                        
                        Severity: Minor
                        Found in src/utils.js - About 1 hr to fix

                          Function doCall has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            async function doCall() {
                              tries += 1;
                              try {
                                const result = await axios({
                                  method,
                          Severity: Minor
                          Found in src/plugins/meteor/docker-registry.js - About 1 hr to fix

                            Function findClusters has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function findClusters(serverInfo) {
                              const usedNodeIds = [];
                              const clusters = currentManagers(serverInfo).reduce((result, manager) => {
                                const {
                                  swarm,
                            Severity: Minor
                            Found in src/swarm-utils.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language