Showing 47 of 47 total issues
Method _resumable_put_block
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _resumable_put_block(bucket,
uptoken,
fh,
block_index,
block_size,
- 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 send_request_with
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def send_request_with url, data = nil, options = {}
options[:method] = Config.settings[:method] unless options[:method]
options[:content_type] = Config.settings[:content_type] unless options[:content_type]
header_options = {
:accept => :json,
- 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 http_request
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def http_request url, data = nil, options = {}
retry_times = 0
begin
retry_times += 1
send_request_with url, data, options
- 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 resumable_upload.rb
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'zlib'
require 'yaml'
require 'tmpdir'
require 'fileutils'
require 'mime/types'
Method _resumable_put_block
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _resumable_put_block(bucket,
uptoken,
fh,
block_index,
block_size,
Method _resumable_put
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _resumable_put(bucket,
uptoken,
fh,
checksums,
progresses,
- 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 upload_buffer_with_token
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def upload_buffer_with_token(uptoken,
buf,
key = nil,
x_vars = nil,
opts = {})
- 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 generate_signature
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def generate_signature
params = {:scope => @scope, :deadline => Time.now.to_i + @expires_in}
params[:callbackUrl] = @callback_url if !@callback_url.nil? && !@callback_url.empty?
params[:callbackBody] = @callback_body if !@callback_body.nil? && !@callback_body.empty?
params[:callbackBodyType] = @callback_body_type if !@callback_body_type.nil? && !@callback_body_type.empty?
- 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 _generate_action_params
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _generate_action_params(local_file,
bucket,
key = nil,
mime_type = nil,
custom_meta = 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 upload_buffer_with_token
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upload_buffer_with_token(uptoken,
buf,
key = nil,
x_vars = nil,
opts = {})
Method send_request_with
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_request_with url, data = nil, options = {}
options[:method] = Config.settings[:method] unless options[:method]
options[:content_type] = Config.settings[:content_type] unless options[:content_type]
header_options = {
:accept => :json,
Method _mkfile
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _mkfile(uphost,
uptoken,
entry_uri,
fsize,
checksums,
Method _resumable_upload
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _resumable_upload(uptoken,
fh,
fsize,
bucket,
key,
Method resumable_upload_with_token
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def resumable_upload_with_token(uptoken,
local_file,
bucket,
key = nil,
mime_type = nil,
Method _resumable_put_block
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _resumable_put_block(bucket,
uptoken,
fh,
block_index,
block_size,
Method upload_with_token
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_with_token(uptoken,
local_file,
bucket,
key = nil,
mime_type = nil,
Method upload_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def upload_file opts = {}
uncontained_opts = [:uptoken, :file, :bucket, :key] - opts.keys
raise MissingArgsError, uncontained_opts unless uncontained_opts.empty?
source_file = opts[: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
Method upload_file
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upload_file opts = {}
uncontained_opts = [:uptoken, :file, :bucket, :key] - opts.keys
raise MissingArgsError, uncontained_opts unless uncontained_opts.empty?
source_file = opts[:file]
Method _resumable_put
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _resumable_put(bucket,
uptoken,
fh,
checksums,
progresses,
Method upload_with_token_2
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def upload_with_token_2(uptoken,
local_file,
key = nil,
x_vars = nil,
opts = {})
- 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"