Showing 20 of 34 total issues
Method setup_credentials
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def setup_credentials
options = {}
credentials_options = {}
case
when @assume_role_credentials
- 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 out_s3.rb
has 585 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fluent/plugin/output'
require 'fluent/log-ext'
require 'fluent/timezone'
require 'aws-sdk-s3'
require 'zlib'
Method write
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def write(chunk)
i = 0
metadata = chunk.metadata
previous_path = nil
time_slice = if metadata.timekey.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
File in_s3.rb
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fluent/plugin/input'
require 'fluent/log-ext'
require 'aws-sdk-s3'
require 'aws-sdk-sqs'
Method setup_credentials
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def setup_credentials
options = {}
credentials_options = {}
case
when @aws_key_id && @aws_sec_key
- 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 write
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write(chunk)
i = 0
metadata = chunk.metadata
previous_path = nil
time_slice = if metadata.timekey.nil?
Method setup_credentials
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_credentials
options = {}
credentials_options = {}
case
when @assume_role_credentials
Method run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def run
options = {}
options[:wait_time_seconds] = @sqs.wait_time_seconds
options[:skip_delete] = @sqs.skip_delete
@poller.before_request do |stats|
- 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 setup_credentials
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_credentials
options = {}
credentials_options = {}
case
when @aws_key_id && @aws_sec_key
Method configure
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(conf)
compat_parameters_convert(conf, :buffer, :formatter, :inject)
super
Method configure
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def configure(conf)
compat_parameters_convert(conf, :buffer, :formatter, :inject)
super
- 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 start
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def start
options = setup_credentials
options[:region] = @s3_region if @s3_region
options[:endpoint] = @s3_endpoint if @s3_endpoint
options[:use_accelerate_endpoint] = @enable_transfer_acceleration
- 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 run
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
options = {}
options[:wait_time_seconds] = @sqs.wait_time_seconds
options[:skip_delete] = @sqs.skip_delete
@poller.before_request do |stats|
Method compress
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def compress(chunk, tmp)
chunk_is_file = @buffer_type == 'file'
path = if chunk_is_file
chunk.path
else
- 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 compress
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compress(chunk, tmp)
chunk_is_file = @buffer_type == 'file'
path = if chunk_is_file
chunk.path
else
Method compress
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compress(chunk, tmp)
chunk_is_file = @buffer_type == "file"
path = if chunk_is_file
chunk.path
else
- 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 configure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def configure(conf)
super
if reject_s3_endpoint?
raise Fluent::ConfigError, "s3_endpoint parameter is not supported for S3, use s3_region instead. This parameter is for S3 compatible services"
- 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
Avoid deeply nested control flow statements. Open
credentials_options[:client] = if iam_user_credentials
Aws::STS::Client.new(region: region, endpoint: c.sts_endpoint_url, credentials: iam_user_credentials)
else
Aws::STS::Client.new(region: region, endpoint: c.sts_endpoint_url)
end
Avoid deeply nested control flow statements. Open
credentials_options[:client] = if iam_user_credentials
Aws::STS::Client.new(region: region, credentials: iam_user_credentials)
else
Aws::STS::Client.new(region: region)
end
Method extract
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract(io)
parts = []
loop do
unused = nil
Zlib::GzipReader.wrap(io) do |gz|
- 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"