FreedomBen/dory

View on GitHub
bin/dory

Summary

Maintainability
Test Coverage

Class has too many lines. [451/250]
Open

class DoryBin < Thor
  class_option :verbose, type: :boolean, aliases: 'v', default: false

  desc 'upgrade', 'Upgrade dory to the latest version'
  long_desc <<-LONGDESC
Severity: Minor
Found in bin/dory by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [51/30]
Open

  def exec_down(options, services)
    services = sanitize_services(services)
    return unless services

    puts "Reading settings file at '#{Dory::Config.filename}'".green if options[:verbose]
Severity: Minor
Found in bin/dory by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for exec_down is too high. [16/6]
Open

  def exec_down(options, services)
    services = sanitize_services(services)
    return unless services

    puts "Reading settings file at '#{Dory::Config.filename}'".green if options[:verbose]
Severity: Minor
Found in bin/dory by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [40/30]
Open

  def exec_up(options, services)
    services = sanitize_services(services)
    return unless services

    puts "Reading settings file at '#{Dory::Config.filename}'".green if options[:verbose]
Severity: Minor
Found in bin/dory by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for exec_up is too high. [15/6]
Open

  def exec_up(options, services)
    services = sanitize_services(services)
    return unless services

    puts "Reading settings file at '#{Dory::Config.filename}'".green if options[:verbose]
Severity: Minor
Found in bin/dory by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [35/30]
Open

  def exec_ip(service, _options)
    s = sanitize_service(service)
    mod = if s == 'proxy'
            Dory::Proxy
          elsif s == 'dns'
Severity: Minor
Found in bin/dory by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for exec_ip is too high. [9/6]
Open

  def exec_ip(service, _options)
    s = sanitize_service(service)
    mod = if s == 'proxy'
            Dory::Proxy
          elsif s == 'dns'
Severity: Minor
Found in bin/dory by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [33/30]
Open

  def exec_upgrade(_options)
    puts "Checking if dory has updates available...".green
    new_version = Dory::Upgrade.new_version
    if new_version
      if Dory::Upgrade.outdated?(new_version)
Severity: Minor
Found in bin/dory by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for exec_pull is too high. [8/6]
Open

  def exec_pull(services, _options)
    servs = services.empty? ? %w[proxy dns] : services
    servs = sanitize_services(servs)
    return unless servs

Severity: Minor
Found in bin/dory by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Cyclomatic complexity for exec_status is too high. [8/6]
Open

  def exec_status(_options)
    puts "Reading settings file at '#{Dory::Config.filename}'".green if options[:verbose]
    settings = Dory::Config.settings

    if Dory::Proxy.running?
Severity: Minor
Found in bin/dory by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Cyclomatic complexity for exec_attach is too high. [7/6]
Open

  def exec_attach(service, _options)
    s = sanitize_service(service)
    mod = if s == 'proxy'
            Dory::Proxy
          elsif s == 'dns'
Severity: Minor
Found in bin/dory by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Avoid more than 4 levels of block nesting.
Open

            if Dory::Upgrade.cleanup.success?
              puts "New version installed successfully!\n" \
                   "You may want to upgrade your config file with:\n\n" \
                   "    dory config-file --upgrade".green
            else
Severity: Minor
Found in bin/dory by rubocop

This cop checks for excessive nesting of conditional and looping constructs.

You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

The maximum level of nesting allowed is configurable.

Avoid more than 4 levels of block nesting.
Open

            if Dory::Dnsmasq.delete
              puts "Dnsmasq container successfully deleted".green
            else
              puts "Dnsmasq container failed to delete".red
            end
Severity: Minor
Found in bin/dory by rubocop

This cop checks for excessive nesting of conditional and looping constructs.

You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

The maximum level of nesting allowed is configurable.

Avoid more than 4 levels of block nesting.
Open

            if Dory::Proxy.delete
              puts "Nginx proxy container successfully deleted".green
            else
              puts "Nginx proxy container failed to delete".red
            end
Severity: Minor
Found in bin/dory by rubocop

This cop checks for excessive nesting of conditional and looping constructs.

You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

The maximum level of nesting allowed is configurable.

There are no issues that match your filters.

Category
Status