flant/superhosting

View on GitHub
lib/superhosting/controller/mux.rb

Summary

Maintainability
A
25 mins
Test Coverage

Method reconfigure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def reconfigure(name:)
        if (resp = useable_validation(name: name)).net_status_ok?
          _reconfigure(name: name)
          index_mux_containers(name: name).each do |container_name|
            break unless (resp = @container_controller.reconfigure(name: container_name)).net_status_ok?
Severity: Minor
Found in lib/superhosting/controller/mux.rb - 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

Line is too long. [152/150]
Open

          @container_controller._update(name: mapper.container_name, docker_options: @container_controller._load_docker_options(lib_mapper: mapper.lib))
Severity: Minor
Found in lib/superhosting/controller/mux.rb by rubocop

Avoid comma after the last item of a hash.
Open

          configuration_applied: { action: :run, undo: :stop, next: :up },
Severity: Minor
Found in lib/superhosting/controller/mux.rb by rubocop

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

There are no issues that match your filters.

Category
Status