Showing 19 of 24 total issues
Method run
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(opts = {})
ios = [ ]
logger.debug("#run starting #{@feed.provider}:#{@feed.name}") if logger.debug?
start = Time.now
changed(true); notify_observers(:start)
Method run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run(opts = {})
ios = [ ]
logger.debug("#run starting #{@feed.provider}:#{@feed.name}") if logger.debug?
start = Time.now
changed(true); notify_observers(:start)
- 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 output_table
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def output_table(io_out)
feed_info = [['provider', 'name', 'type', 'link/path', 'event_types']]
registry.each do |feed|
Method _init_mod
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _init_mod
parser = self
Module.new do
extend Helpers
extend GLI::App
Method build
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build
opts = {
feed_provider: @feed_provider,
feed_name: @feed_name,
}
Method build
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build
opts = {
feed_provider: @feed_provider,
feed_name: @feed_name,
}
- 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 parse_record
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_record(record)
@built_events.clear
events = []
changed(true); notify_observers(:start_parse_record, record)
Method properties
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.properties(namespace = nil)
ret = {}
self.attribute_set.each do |attribute|
name = attribute.name.to_s
unless namespace.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 load_files
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def load_files(file_names)
file_names.each do |file_name|
path, type, name = split_file_name(file_name)
next if path.nil?
# Don't try to load unit tests as plugins :)
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(name, opts = {})
unless name.kind_of?(::Symbol) or name.kind_of?(::String)
raise TypeError.new("name must be a String or a Symbol")
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 _init_mod
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _init_mod
parser = self
Module.new do
extend Helpers
extend GLI::App
- 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_element_namespace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
Method from_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.from_string(str, filename = nil, lineno = nil)
from_dsl do
args = [str, binding]
unless filename.nil?
args << filename
- 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 each
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each(type = nil)
return enum_for(:each, type) unless block_given?
@plugin_types_registry.each do |t, type_registry|
unless type.nil?
next unless type.to_sym == t
- 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 _build_csv_opts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _build_csv_opts
opts = {}.merge(@csv_opts)
opts[:return_headers] = true
opts[:row_sep] = @row_separator unless @row_separator.nil?
opts[:col_sep] = @col_separator unless @col_separator.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 decode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decode(io)
zio = Zlib::GzipReader.new(io, encoding: "binary")
tempfile = Tempfile.new("threatinator", encoding: "binary")
while chunk = zio.read(10240)
tempfile.write(chunk)
- 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 config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def config
run_hash = config_hash["run"] || {}
run_hash['observers'] ||= []
if filename = run_hash['coverage_output']
- 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_element_namespace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
@element_stack.push(name)
if @parsing_stack.empty?
if @element_stack.length > @max_depth
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run(io)
lineno = 1
previous_pos = io.pos
csv = ::CSV.new(io, _build_csv_opts())
csv.each do |row|
- 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"