File types.rb
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
module HQMF
# Used to represent 'any value' in criteria that require a value be present but
# don't specify any restrictions on that value
class AnyValue
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(type,system,code,code_list_id=nil,title=nil,null_flavor=nil,original_text=nil)
Method stringify
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def stringify
if (@high && @low)
if (@high.value == @low.value and @high.inclusive? and low.inclusive?)
"#{@low.stringify}"
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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(type,unit,value,inclusive,derived,expression)
Method from_json
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.from_json(json)
type = json["type"] if json["type"]
unit = json["unit"] if json["unit"]
value = json["value"] if json["value"]
inclusive = json["inclusive?"] unless json["inclusive?"].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 from_json
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.from_json(json)
json = json.with_indifferent_access
type = json["type"] if json["type"]
system = json["system"] if json["system"]
code = json["code"] if json["code"]
- 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"