Showing 6 of 6 total issues

File fuguta.rb has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Fuguta
  class ValidationError < StandardError
    attr_reader :errors
    def initialize(errors)
      super("validation error")
Severity: Minor
Found in lib/fuguta.rb - About 3 hrs to fix

    Class Configuration has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Configuration
        ValidationError = Fuguta::ValidationError
    
        def self.usual_paths(paths = nil)
          if paths
    Severity: Minor
    Found in lib/fuguta.rb - About 2 hrs to fix

      Method walk_tree has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.walk_tree(conf, &blk)
            raise ArgumentError, "conf must be a 'Configuration'. Got '#{conf.class}'." unless conf.is_a?(Configuration)
      
            blk.call(conf)
            conf.config.values.each { |c|
      Severity: Minor
      Found in lib/fuguta.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 load has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def load(path = nil)
              buf = case path
              when NilClass
                raise "No path given and usual_paths not set" unless @conf.usual_paths
      
      
      Severity: Minor
      Found in lib/fuguta.rb - 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

      Method def_configuration has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

              def def_configuration(&blk)
                # create new configuration class if not exist.
                if self.const_defined?(:Configuration, false)
                  unless self.const_get(:Configuration, false) < Fuguta::Configuration
                    raise TypeError, "#{self}::Configuration constant is defined already for another purpose."
      Severity: Minor
      Found in lib/fuguta.rb - 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

      Method load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def load(*paths)
              l = Loader.new(@subject)
              paths.each { |path|
                if path =~ %r{^/}
                  # Load absolute path
      Severity: Minor
      Found in lib/fuguta.rb - 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

      Severity
      Category
      Status
      Source
      Language