Showing 3 of 25 total issues
Method ok_values
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def ok_values
%i(decimal upperRoman lowerRoman upperLetter lowerLetter ordinal
cardinalText ordinalText hex chicago ideographDigital japaneseCounting
aiueo iroha decimalFullWidth decimalHalfWidth japaneseLegal
japaneseDigitalTenThousand decimalEnclosedCircle decimalFullWidth2
Method to_xml
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def to_xml
build_xml do |xml|
xml.document(root_namespaces) {
xml.parent.namespace = :w
background.to_xml(xml) unless @background.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 to_xml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def to_xml(xml)
xml["w"].public_send(tag, xml_attributes) {
property_xml(xml)
@paragraph_style.property_xml(xml) unless @paragraph_style.nil?
@character_style.property_xml(xml) unless @character_style.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"