zodern/meteor-up

View on GitHub

Showing 160 of 160 total issues

Function scrubUrl has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  scrubUrl(url) {
    const {
      protocol,
      auth,
      hostname,
Severity: Minor
Found in src/scrub-config.js - About 1 hr to fix

    Function locatePluginDir has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function locatePluginDir(name, configPath, appPath) {
      log(`loading plugin ${name}`);
    
      if (name.indexOf('.') === 0 || name.indexOf('/') === 0 || name.indexOf('~') === 0) {
        log('plugin name is a path to the plugin');
    Severity: Minor
    Found in src/load-plugins.js - About 1 hr to fix

      Function login has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      async function login(registryConfig, authConfig) {
        const query = {};
        let url = authConfig.parms.realm;
        if (authConfig.parms.service) {
          query.service = authConfig.parms.service;
      Severity: Minor
      Found in src/plugins/meteor/docker-registry.js - About 1 hr to fix

        Function showClusters has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function showClusters(clusters, nodeIds) {
          console.log('');
          console.log('=> List of Swarm Clusters:');
        
          Object.keys(clusters).forEach(clusterId => {
        Severity: Minor
        Found in src/swarm-utils.js - About 1 hr to fix

          Function createBuildArgs has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function createBuildArgs(buildOptions, appPath) {
            const args = [
              'build',
              '--directory',
              buildOptions.buildLocation,
          Severity: Minor
          Found in src/plugins/meteor/build.js - About 1 hr to fix

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

            export const status = {
              description: 'View status of your app, databases and other components',
              handler: commandHandlers.status,
              builder(yargs) {
                return yargs.option('overview', {
            Severity: Major
            Found in src/plugins/default/commands.js and 3 other locations - About 1 hr to fix
            src/plugins/meteor/commands.js on lines 19..28
            src/plugins/meteor/commands.js on lines 70..79
            src/plugins/mongo/commands.js on lines 31..40

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

            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 4 locations. Consider refactoring.
            Open

            export const status = {
              description: 'View the app\'s status',
              handler: commandHandlers.status,
              builder(yargs) {
                return yargs.option('overview', {
            Severity: Major
            Found in src/plugins/meteor/commands.js and 3 other locations - About 1 hr to fix
            src/plugins/default/commands.js on lines 88..97
            src/plugins/meteor/commands.js on lines 19..28
            src/plugins/mongo/commands.js on lines 31..40

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

            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 4 locations. Consider refactoring.
            Open

            export const destroy = {
              description: 'Stop and completely remove app from server',
              handler: commandHandlers.destroy,
              builder(subYargs) {
                return subYargs.option('force', {
            Severity: Major
            Found in src/plugins/meteor/commands.js and 3 other locations - About 1 hr to fix
            src/plugins/default/commands.js on lines 88..97
            src/plugins/meteor/commands.js on lines 70..79
            src/plugins/mongo/commands.js on lines 31..40

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

            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 const deploy = {
              description: 'Deploy app to server',
              builder(yargs) {
                return yargs.option('cached-build', {
                  description: 'Use build from previous deploy',
            Severity: Major
            Found in src/plugins/default/commands.js and 1 other location - About 1 hr to fix
            src/plugins/meteor/commands.js on lines 8..17

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

            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

              list.copy('Sending let\'s encrypt environment variables', {
                src: api.resolvePath(__dirname, 'assets/templates/env.list'),
                dest: `/opt/${PROXY_CONTAINER_NAME}/config/env_letsencrypt.list`,
                vars: {
                  env: envLetsEncrypt || {}
            Severity: Major
            Found in src/plugins/proxy/command-handlers.js and 1 other location - About 1 hr to fix
            src/plugins/proxy/command-handlers.js on lines 200..206

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

            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 4 locations. Consider refactoring.
            Open

            export const status = {
              description: 'View MongoDB status',
              handler: commandHandlers.status,
              builder(yargs) {
                return yargs.option('overview', {
            Severity: Major
            Found in src/plugins/mongo/commands.js and 3 other locations - About 1 hr to fix
            src/plugins/default/commands.js on lines 88..97
            src/plugins/meteor/commands.js on lines 19..28
            src/plugins/meteor/commands.js on lines 70..79

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

            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

              list.copy('Sending proxy environment variables', {
                src: api.resolvePath(__dirname, 'assets/templates/env.list'),
                dest: `/opt/${PROXY_CONTAINER_NAME}/config/env.list`,
                vars: {
                  env: env || {}
            Severity: Major
            Found in src/plugins/proxy/command-handlers.js and 1 other location - About 1 hr to fix
            src/plugins/proxy/command-handlers.js on lines 210..216

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

            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 const deploy = {
              description: 'Deploy meteor apps',
              builder(subYargs) {
                return subYargs.option('cached-build', {
                  description: 'Use build from previous deploy',
            Severity: Major
            Found in src/plugins/meteor/commands.js and 1 other location - About 1 hr to fix
            src/plugins/default/commands.js on lines 9..18

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

            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 getConfig has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              getConfig(validate = true) {
                if (!this.config) {
                  try {
                    delete require.cache[require.resolve(this.configPath)];
                    // eslint-disable-next-line global-require
            Severity: Minor
            Found in src/plugin-api.js - About 1 hr 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 setupSwarm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            export async function setupSwarm(api) {
              const config = api.getConfig();
            
              if (!api.swarmEnabled()) {
                return;
            Severity: Minor
            Found in src/plugins/docker/command-handlers.js - About 1 hr 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 copy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function copy(session, _options, callback) {
              const options = clone(_options);
              let retries = 0;
            
              if (typeof options.hostVars === 'object' && options.hostVars[session._host]) {
            Severity: Minor
            Found in src/nodemiral.js - About 1 hr 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 runTaskList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function runTaskList(list, sessions, opts) {
              if (opts && opts.verbose) {
                addStdioHandlers(list);
                delete opts.verbose;
              }
            Severity: Minor
            Found in src/utils.js - About 1 hr to fix

              Function getSettingsFromPath has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                getSettingsFromPath(settingsPath) {
                  const filePath = resolvePath(settingsPath);
                  let settings;
              
                  try {
              Severity: Minor
              Found in src/plugin-api.js - About 1 hr to fix

                Function checkCompatible has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export async function checkCompatible(registryConfig) {
                  try {
                    const host = getHost(registryConfig);
                    await axios.get(`https://${host}/v2`);
                    log(host);
                Severity: Minor
                Found in src/plugins/meteor/docker-registry.js - About 1 hr to fix

                  Function shell has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function shell(api) {
                    const config = api.getConfig();
                  
                    const mongoServer = Object.keys(config.mongo.servers)[0];
                    const server = config.servers[mongoServer];
                  Severity: Minor
                  Found in src/plugins/mongo/command-handlers.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language