padrino/padrino-framework

View on GitHub
padrino-core/lib/padrino-core/reloader.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method object_sources has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def object_sources(target)
      sources = Set.new
      target.methods.each do |method_name|
        next unless method_name.kind_of?(Symbol)
        method_object = target.method(method_name)
Severity: Minor
Found in padrino-core/lib/padrino-core/reloader.rb - 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

Method safe_load has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def safe_load(file, options={})
      began_at = Time.now
      file     = figure_path(file)
      return unless options[:force] || file_changed?(file)
      return require(file) if feature_excluded?(file)
Severity: Minor
Found in padrino-core/lib/padrino-core/reloader.rb - 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

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

    def remove_constant(const)
      return if constant_excluded?(const)
      base, _, object = const.to_s.rpartition('::')
      base = base.empty? ? Object : base.constantize
      base.send :remove_const, object
Severity: Minor
Found in padrino-core/lib/padrino-core/reloader.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

There are no issues that match your filters.

Category
Status