Showing 4 of 22 total issues
Method office_theme
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.office_theme
new.tap do |theme|
theme.theme_name = "Office Theme"
theme.theme_elements.color_scheme.tap do |scheme|
scheme.scheme_name = "Office"
Method add_child_part
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def add_child_part(part, with_index: nil)
part.path = indexed_path(part.path, with_index) unless with_index.nil?
part.parent = self if part.respond_to?(:parent=)
add_relationship part.relationship_type, part.path
return unless instance_variable_defined?("@parent")
- 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 build_slide_master
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_slide_master(named: nil, theme: nil)
OpenXml::Pptx::Parts::SlideMaster.new.tap do |slide_master|
slide_master.common_slide_data.slide_name = named unless named.nil?
slide_master.set_theme(theme) unless theme.nil?
add_slide_master(slide_master)
- 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 build_slide
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_slide(named: nil, slide_layout: nil)
OpenXml::Pptx::Parts::Slide.new.tap do |slide|
slide.common_slide_data.slide_name = named unless named.nil?
slide.set_slide_layout(slide_layout) unless slide_layout.nil?
add_slide(slide)
- 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"