Method process_blobs_directory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def process_blobs_directory
@updated_blobs = []
@new_blobs = []
Dir[File.join(@blobs_dir, "**", "*")].each do |file|
- Read upRead up
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
File blob_manager.rb
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Bosh::Cli
# In order to avoid storing large objects in git repo,
# release might save them in the blobstore instead.
# BlobManager encapsulates most of the blob operations.
class BlobManager
Method initialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def initialize(release)
@release = release
@index_file = File.join(@release.dir, "config", DEFAULT_INDEX_NAME)
legacy_index_file = File.join(@release.dir, "blob_index.yml")
- Read upRead up
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 download_blob
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def download_blob(path)
unless @index.has_key?(path)
err("Unknown blob path `#{path}'")
end
- Read upRead up
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 add_blob
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_blob(local_path, blob_path)
unless File.exists?(local_path)
err("File `#{local_path}' not found")
end
Method initialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(release)
@release = release
@index_file = File.join(@release.dir, "config", DEFAULT_INDEX_NAME)
legacy_index_file = File.join(@release.dir, "blob_index.yml")
Method add_blob
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def add_blob(local_path, blob_path)
unless File.exists?(local_path)
err("File `#{local_path}' not found")
end
- Read upRead up
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 download_blob
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def download_blob(path)
unless @index.has_key?(path)
err("Unknown blob path `#{path}'")
end
Method process_index
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process_index
@index.each_pair do |path, entry|
if File.exists?(File.join(@src_dir, path))
err("File `#{path}' is in both blob index and src directory.\n" +
"Please fix release repo before proceeding")
- Read upRead up
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"