lib/jekyll-spaceship/processors/table-processor.rb
Method on_handle_markdown
has 50 lines of code (exceeds 30 allowed). Consider refactoring. Open
Open
def on_handle_markdown(content)
# pre-handle reference-style links
references = {}
content.scan(/\n\s*(\[(.*)\]:\s*(\S+(\s+".*?")?))/) do |match_data|
ref_name = match_data[1]
Method handle_attr_list
has a Cognitive Complexity of 24 (exceeds 15 allowed). Consider refactoring. Open
Open
def handle_attr_list(data)
cell = data.cell
content = cell.inner_html
# inline attribute list(IAL) handler
ial_handler = ->(list) do
- 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 handle_attr_list
has 34 lines of code (exceeds 30 allowed). Consider refactoring. Open
Open
def handle_attr_list(data)
cell = data.cell
content = cell.inner_html
# inline attribute list(IAL) handler
ial_handler = ->(list) do
Method on_handle_html
has 32 lines of code (exceeds 30 allowed). Consider refactoring. Open
Open
def on_handle_html(content)
# use nokogiri to parse html content
doc = Nokogiri::HTML(content)
data = self.table_scope_data
Method on_handle_markdown
has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring. Open
Open
def on_handle_markdown(content)
# pre-handle reference-style links
references = {}
content.scan(/\n\s*(\[(.*)\]:\s*(\S+(\s+".*?")?))/) do |match_data|
ref_name = match_data[1]
- 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"