Showing 292 of 292 total issues
Method Segment
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Segment(position, segment_def, name, requirement, repeat_count, *elements)
unless elements.length == segment_def.element_uses.length
raise Exceptions::InvalidSchemaError,
"segment #{segment_def.id} has #{segment_def.element_uses.length}" +
" elements but #{elements.length} arguments were given"
Identical blocks of code found in 2 locations. Consider refactoring. Open
{:IK5=>
[{:E717=>{:name=>"Transaction Set Acknowledgement Code", :value=>{:raw=>"R", :description=>"Rejected"}, :type=>:simple}},
{:E618=>{:name=>"Implementation Transaction Set Syntax Error Code", :value=>{:raw=>"5", :description=>"One or More Segments in Error"}, :type=>:simple}},
{:E618=>{:name=>"Implementation Transaction Set Syntax Error Code", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
{:E618=>{:name=>"Implementation Transaction Set Syntax Error Code", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 81.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
{:IK5=>
[{:E717=>{:name=>"Transaction Set Acknowledgement Code", :value=>{:raw=>"R", :description=>"Rejected"}, :type=>:simple}},
{:E618=>{:name=>"Implementation Transaction Set Syntax Error Code", :value=>{:raw=>"5", :description=>"One or More Segments in Error"}, :type=>:simple}},
{:E618=>{:name=>"Implementation Transaction Set Syntax Error Code", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
{:E618=>{:name=>"Implementation Transaction Set Syntax Error Code", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 81.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method mod_element
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def mod_element(element_use, descriptor, requirement, name, arguments)
unless requirement.is_a?(Schema::ElementReq)
raise Exceptions::InvalidSchemaError,
"first argument to Element must be a Schema::ElementReq but got #{requirement.inspect} for #{descriptor}"
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 __filter?
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def __filter?(filter_tok, invalid_val)
return true unless filter_tok.id == invalid_val.id
children = invalid_val.segment_tok.element_toks
filter_tok.element_toks.zip(children) do |f_tok, e_tok|
- 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 filter?
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def filter?(filter_tok, segment_val)
return true unless filter_tok.id == segment_val.id
filter_tok.element_toks.zip(segment_val.children) do |f_tok, e_val|
if f_tok.simple?
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
class Config
#
# The functional group segments (GS/GE) and the segments contained by that
# functional group are versioned separately from the interchange control
# segments (ISA/ISE). The functional group version is informally referred to
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
class Config
#
# The interchange control segments (ISA/ISE) are versioned independently
# from the functional group segments (GS/GE). Because different interchange
# versions can have unique grammars, this table serves as an indirection.
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
{:CTX=>
[{:C998=>{:name=>"CONTEXT IDENTIFICATION", :value=>[[{:raw=>"CLM01", :description=>nil}, {:raw=>"987654321", :description=>nil}]], :type=>:repeated}},
{:E721=>{:name=>"Segment ID Code", :value=>{:raw=>"", :description=>""}, :type=>:simple}},
{:E719=>{:name=>"Segment Position in Transaction Set", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
{:E447=>{:name=>"Loop Identifier Code", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
{:CTX=>
[{:C998=>{:name=>"CONTEXT IDENTIFICATION", :value=>[[{:raw=>"CLM01", :description=>nil}, {:raw=>"123456789", :description=>nil}]], :type=>:repeated}},
{:E721=>{:name=>"Segment ID Code", :value=>{:raw=>"", :description=>""}, :type=>:simple}},
{:E719=>{:name=>"Segment Position in Transaction Set", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
{:E447=>{:name=>"Loop Identifier Code", :value=>{:raw=>"", :description=>nil}, :type=>:simple}},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method between
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def between(other)
# Collect ancestors of self, sorted oldest first (deepest last). This
# forms a boundary of nodes, which is called a "spine" below
zipper = self
lspine = [self]
File tm.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Stupidedi
using Refinements
module Versions
module Common
Method matches
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def matches(segment_tok, strict, mode)
invalid = true # Were all present possibly distinguishing elements invalid?
present = false # Were any possibly distinguishing elements present?
disjoint, distinct = basis(@instructions, mode)
Method next
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def next(count = 1)
unless count > 0
raise ArgumentError,
"count must be positive"
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 sequence
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def sequence(segment_uses, offset = 0)
instructions = []
buffer = []
last = 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 read_elements
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def read_elements(segment_id, element_uses)
if element_uses.empty?
read_simple_element
else
element_use = element_uses.head
- 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 prev
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def prev(count = 1)
unless count > 0
raise ArgumentError,
"count must be positive"
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 tsequence
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def tsequence(table_defs, offset = 0)
instructions = []
buffer = []
last = 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 lsequence
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def lsequence(loop_defs, offset = 0)
instructions = []
buffer = []
last = 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 process
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process
return unless owner.is_a?(Hash)
return unless owner[:source] and owner[:describes]
node = YARD::Registry.resolve(nil, owner[:describes], true)
- 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"