experteer/blobsterix

View on GitHub
lib/blobsterix/storage/file_system.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def list(bucket="root", opts={})
        begin
          if bucket =~ /root/
            list_buckets
          else
Severity: Minor
Found in lib/blobsterix/storage/file_system.rb - About 55 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def create(bucket)
        begin
          logger.info "Storage: create bucket #{contents(bucket)}"
          FileUtils.mkdir_p(contents(bucket)) unless File.exist?(contents(bucket))
          FileUtils.touch File.join(contents(bucket), ".keep")
Severity: Minor
Found in lib/blobsterix/storage/file_system.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

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

      def delete(bucket)
        begin
          logger.info "Storage: delete bucket #{contents(bucket)}"
          FileUtils.rm_rf(contents(bucket)) if bucket_exist(bucket) && bucket_empty?(bucket)
        rescue => e
Severity: Minor
Found in lib/blobsterix/storage/file_system.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

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

      def get(bucket, key)
        begin
          if (not File.directory?(contents(bucket, key))) # and bucket_files(bucket).include?(key)
            Blobsterix.storage_read(BlobAccess.new(:bucket => bucket, :id => key))
            metaData(bucket, key)
Severity: Minor
Found in lib/blobsterix/storage/file_system.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