zodern/meteor-up

View on GitHub

Showing 78 of 160 total issues

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

          Function copy has 26 lines of code (exceeds 25 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

            Function start has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function validateConfig has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                validateConfig(configPath, logProblems) {
                  // Only print errors once.
                  if (this.validationErrors.length > 0) {
                    return this.validationErrors;
                  }
              Severity: Minor
              Found in src/plugin-api.js - About 1 hr to fix

                Function prepareConfig has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function prepareConfig(config) {
                  if (!config.app || !config.proxy) {
                    return config;
                  }
                
                
                Severity: Minor
                Found in src/plugins/proxy/index.js - About 1 hr to fix

                  Function checkCompatible has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 prepareConfig has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function prepareConfig(config) {
                    if (!config.app || !config.proxy) {
                      return config;
                    }
                  
                  
                  Severity: Minor
                  Found in src/plugins/proxy/index.js - About 55 mins 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 debugApp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export async function debugApp(api) {
                    const {
                      servers,
                      app
                    } = api.getConfig();
                  Severity: Minor
                  Found in src/plugins/meteor/command-handlers.js - About 55 mins 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 scrubConfig has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function scrubConfig(config, utils) {
                    if (config.meteor) {
                      delete config.meteor;
                    }
                  
                  
                  Severity: Minor
                  Found in src/plugins/meteor/index.js - About 55 mins 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 registerPlugin has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function registerPlugin(plugin) {
                    if (plugin.module.commands) {
                      Object.keys(plugin.module.commands).forEach(key => {
                        registerCommand(plugin.name, key, plugin.module.commands[key]);
                      });
                  Severity: Minor
                  Found in src/load-plugins.js - About 45 mins 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 default has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function(
                    config,
                    {
                      addDepreciation,
                      combineErrorDetails,
                  Severity: Minor
                  Found in src/plugins/meteor/validate.js - About 45 mins 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 envconfig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function envconfig(api) {
                    log('exec => mup meteor envconfig');
                    const {
                      servers,
                      app,
                  Severity: Minor
                  Found in src/plugins/meteor/command-handlers.js - About 45 mins 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 newerStable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function newerStable(local, remote) {
                    for (let i = 0; i < 3; i++) {
                      for (let sameIndex = 0; sameIndex < i; sameIndex += 1) {
                        if (local[sameIndex] !== remote[sameIndex]) {
                          return false;
                  Severity: Minor
                  Found in src/updates.js - About 45 mins 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 statusColor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    versionCorrect,
                    distributionCorrect,
                    hasAptGet,
                    defaultBash,
                    _overallColor
                  Severity: Minor
                  Found in src/plugins/default/command-handlers.js - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language