Showing 5 of 7 total issues
Method create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create(model, to, lang = Lang::ObjC)
to = File.dirname(model) unless to
@xml = REXML::Document.new(open(File.expand_path("contents", model)))
@objects = @xml.get_elements('model/entity')
@entities = @objects.map{ |o|
- 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 swift
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def swift(e)
name = e["representedClassName"]
entity = e["parentEntity"]
init = entity ? "[super initWithEntity:entity]" : "[super init]"
parentEntity = entity ? ": #{entity}Wrapper" : ": NSObject"
- 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 implementation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def implementation(e)
name = e["representedClassName"]
init = e["parentEntity"] ? "[super initWithEntity:entity]" : "[super init]"
getter = e["parentEntity"] ? "- (BloodPressure *)entity {\n return (BloodPressure *) [super entity];\n}\n\n" : ""
first = e["parentEntity"] ? "" : " _entity = entity;\n"
- 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_objc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def output_objc(entities, to)
entities.map {|e|
file_name = e["representedClassName"]
hw = header(e)
File.write( File.expand_path("_#{file_name}Wrapper.h", to), hw)
- 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 header
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def header(e)
name = e["representedClassName"]
entity = e["parentEntity"]
import = entity ? "\#import \"#{entity}Wrapper.h\"\n" : "#import <Foundation/Foundation.h>\n"
parentEntity = entity ? "#{entity}Wrapper" : "NSObject"
- 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"