stevekaplan123/carpe_diem

View on GitHub
th-pg-config=/path/to/pg_config/gems/pg-0.18.1/sample/wal_shipper.rb

Summary

Maintainability
C
7 hrs
Test Coverage

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

        def copy_file( wal, path, label, compress=false )
            dest_file = path + wal.basename
            FileUtils::cp wal, dest_file
            if compress
                system *[ 'gzip', '-f', dest_file ]

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 dispatch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def dispatch
            # Synchronous mode.
            #
            unless @async
                self.log "Performing a synchronous dispatch."

    Method ship_rsync_ssh has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def ship_rsync_ssh( dest )
                if dest.host.nil?
                    self.log "Destination %p missing required 'host' key.  WAL is queued." % [ dest.host ]
                    return
                end

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

              def ship_rsync_ssh( dest )
                  if dest.host.nil?
                      self.log "Destination %p missing required 'host' key.  WAL is queued." % [ dest.host ]
                      return
                  end

      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 ship_file has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

              def ship_file( dest )
                  if dest.path.nil?
                      self.log "Destination %p missing required 'path' key.  WAL is queued." % [ dest ]
                      return
                  end

      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 validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def validate
                  # Check for required destination keys
                  %w[ label kind ].each do |key|
                      if self.send( key.to_sym ).nil?
                          self.log "Destination %p missing required '%s' key." % [ self, key ]
      Severity: Minor
      Found in th-pg-config=/path/to/pg_config/gems/pg-0.18.1/sample/wal_shipper.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def initialize( wal, conf )
                  # Make the config keys instance variables.
                  conf.each_pair {|key, val| self.instance_variable_set( "@#{key}", val ) }
      
                  # Spool directory check.
      Severity: Minor
      Found in th-pg-config=/path/to/pg_config/gems/pg-0.18.1/sample/wal_shipper.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

      There are no issues that match your filters.

      Category
      Status