zodern/meteor-up

View on GitHub

Showing 78 of 160 total issues

Function status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export async function status(api) {
  const config = api.getConfig();
  const lines = [];
  let overallColor = 'green';

Severity: Minor
Found in src/plugins/proxy/command-handlers.js - About 35 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 validateConfig has a Cognitive Complexity of 7 (exceeds 5 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 35 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 status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export async function status(api) {
  const config = api.getConfig();

  if (!config.mongo) {
    return;
Severity: Minor
Found in src/plugins/mongo/command-handlers.js - About 35 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 setup has a Cognitive Complexity of 7 (exceeds 5 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: Minor
Found in src/plugins/proxy/command-handlers.js - About 35 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 diffEnv has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function diffEnv(wantedEnv, _currentEnv) {
  const toAdd = [];
  const toRemove = [];

  const currentEnv = _currentEnv.reduce((result, env) => {
Severity: Minor
Found in src/tasks/index.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

export function scrubConfig(config) {
  if (config.servers) {
    // eslint-disable-next-line
    config.servers = traverse(config.servers).map(function() {
      if (this.path.length !== 2) {
Severity: Minor
Found in src/plugins/default/index.js - About 35 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

Avoid too many return statements within this function.
Open

    return globalPath;
Severity: Major
Found in src/load-plugins.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return false;
    Severity: Major
    Found in src/plugins/meteor/docker-registry.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return name;
      Severity: Major
      Found in src/load-plugins.js - About 30 mins to fix

        Function addProxyEnv has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        export function addProxyEnv(config, env) {
          const sslConfig = config.proxy.ssl;
        
          env.VIRTUAL_HOST = config.proxy.domains;
          env.HTTPS_METHOD = sslConfig && sslConfig.forceSSL ? 'redirect' : 'noredirect';
        Severity: Minor
        Found in src/plugins/proxy/utils.js - About 25 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 prepareBundle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        export async function prepareBundle(api) {
          log('exec => mup meteor prepare-bundle');
          const {
            app: appConfig,
            privateDockerRegistry
        Severity: Minor
        Found in src/plugins/meteor/command-handlers.js - About 25 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 build has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        export async function build(api) {
          const config = api.getConfig().app;
          const appPath = api.resolvePath(api.getBasePath(), config.path);
          const buildOptions = config.buildOptions;
        
        
        Severity: Minor
        Found in src/plugins/meteor/command-handlers.js - About 25 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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        export function validate(api) {
          // Shows validation errors
          api.getConfig();
        
          if (api.getOptions().show || api.getOptions().scrub) {
        Severity: Minor
        Found in src/plugins/default/command-handlers.js - About 25 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 createBuildArgs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function createBuildArgs(buildOptions, appPath) {
          const args = [
            'build',
            '--directory',
            buildOptions.buildLocation,
        Severity: Minor
        Found in src/plugins/meteor/build.js - About 25 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 findDestination has a Cognitive Complexity of 6 (exceeds 5 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 25 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 login has a Cognitive Complexity of 6 (exceeds 5 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 25 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 locatePluginDir has a Cognitive Complexity of 6 (exceeds 5 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 25 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function statusColor(
          versionCorrect,
          distributionCorrect,
          hasAptGet,
          defaultBash,
        Severity: Minor
        Found in src/plugins/default/command-handlers.js - About 25 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

        Severity
        Category
        Status
        Source
        Language