Showing 9 of 31 total issues
Method build
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.build(props)
attrs = props.inject({}) do |hash, prop|
hash[prop[:name]] = case prop[:name]
when 'divisibility' then prop[:value].to_i
when 'initialSupply' then prop[:value].to_i
- 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_options
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_options(options = {})
defaults = DEFAULTS.dup
options = options.dup
defaults[:url] = defaults[:url].call if defaults[:url].respond_to?(:call)
- 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_options
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_options(options = {})
defaults = DEFAULTS.dup
options = options.dup
defaults[:url] = defaults[:url].call if defaults[:url].respond_to?(:call)
Method request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def request(method, path, params = {})
log(method, path, params)
if connection.remote? && local_only?(path)
raise Nis::Error, "The request (#{method} #{path}) is only permitted to local NIS."
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 mosaics_fee
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def mosaics_fee
FEE_FACTOR * @transaction.mosaics.inject(0) do |sum, mo_attachment|
mo = mo_attachment.mosaic_definition
quantity = mo_attachment.quantity
tmp_fee = 0
- 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 apostille
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apostille
if @network == :testnet
if private?
raise 'Not implemented private apostille.'
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 rental
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rental
if @network == :testnet
if root?
{ fee: 100 * 1_000_000,
sink: 'TAMESPACEWH4MKFMBCVFERDPOOP4FK7MTDJEYP35' }
- 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 to_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_hash
entity = @transaction.clone
entity.amount *= 1_000_000 if entity.respond_to?(:amount)
- 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 to_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_hash
entity = @transaction.clone
entity.amount *= 1_000_000 if entity.respond_to?(:amount)
- 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"