Showing 9 of 9 total issues
Method tarball_links
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def tarball_links(json)
json.each do |_, v|
next unless v.is_a? Hash
if v['shasum'] && v['tarball']
if v['tarball'].start_with?(@from)
- 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 fetch_index
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def fetch_index
url = from '-/all'
path = to '-/all/index.json'
resp = fetch url, path
fail Error, "Failed to fetch #{url}" if resp.nil?
- 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 fetch
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch(url, path = nil)
uri = URI url
etag = etag_for path
req = Net::HTTP::Get.new uri.path
Method fetch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fetch(url, path = nil)
uri = URI url
etag = etag_for path
req = Net::HTTP::Get.new uri.path
- 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 correct_tarball_url
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def correct_tarball_url
Dir.glob("#{to}/*/index.json").each do |filename|
json = JSON.load(File.open(filename, 'rb').read)
next unless json['versions']
versions = json['versions'].keys
- 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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(from = DEFAULT_FROM, to = DEFAULT_TO,
server = DEFAULT_SERVER, parallelism = 10,
recheck = false)
Avoid too many return
statements within this method. Open
return resp
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return nil