chore: upgrade ameba-linter to 0.9.0 #8
Crystal Ameba Results
Total files checked: 27
Issues found: 34
Ameba Version: 1.6.1
Crystal Version: 1.10.0
Annotations
Check warning on line 5 in src/markd/utils.cr
github-actions / Ameba
Lint/MissingBlockArgument
Missing anonymous block argument. Use `&` as an argument name to indicate yielding method.
Raw output
> def self.timer(label : String, measure_time? : Bool)
^
Check warning on line 17 in src/markd/utils.cr
github-actions / Ameba
Lint/ShadowingOuterLocalVar
Shadowing outer local variable `text`
Raw output
> HTML.decode_entities(text).gsub(DECODE_ENTITIES_REGEX) { |text| text[1].to_s }
^
Check notice on line 17 in src/markd/utils.cr
github-actions / Ameba
Style/VerboseBlock
Use short block notation instead: `gsub(DECODE_ENTITIES_REGEX, &.[1].to_s)`
Raw output
> HTML.decode_entities(text).gsub(DECODE_ENTITIES_REGEX) { |text| text[1].to_s }
^
Check warning on line 55 in spec/spec_helper.cr
github-actions / Ameba
Lint/UselessAssign
Useless assignment to variable `data`
Raw output
> data = [] of String
^
Check warning on line 56 in spec/spec_helper.cr
github-actions / Ameba
Lint/UselessAssign
Useless assignment to variable `delimiter`
Raw output
> delimiter = "`" * 32
^
Check warning on line 54 in spec/spec_helper.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [21/10]
Raw output
> def extract_spec_tests(file)
^
Check notice on line 67 in spec/spec_helper.cr
github-actions / Ameba
Naming/BlockParameterName
Disallowed block parameter name found
Raw output
> File.open(path) do |f|
^
Check warning on line 159 in src/markd/node.cr
github-actions / Ameba
Lint/UselessAssign
Useless assignment to variable `nxt`
Raw output
> elsif nxt = current.next?
^
Check notice on line 12 in src/markd/rules/html_block.cr
github-actions / Ameba
Style/ParenthesesAroundCondition
Redundant parentheses
Raw output
> if (text.match(regex) &&
^
Check warning on line 8 in src/markd/rules/heading.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [11/10]
Raw output
> def match(parser : Parser, container : Node) : MatchValue
^
Check warning on line 52 in src/markd/renderer.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [18/10]
Raw output
> def render(document : Node)
^
Check warning on line 80 in src/markd/parsers/block.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [29/10]
Raw output
> private def process_line(line : String)
^
Check notice on line 176 in src/markd/parsers/block.cr
github-actions / Ameba
Style/ParenthesesAroundCondition
Redundant parentheses
Raw output
> if (container_type.html_block? && match_html_block?(container))
^
Check notice on line 195 in src/markd/parsers/block.cr
github-actions / Ameba
Style/ParenthesesAroundCondition
Redundant parentheses
Raw output
> while (event = walker.next)
^
Check warning on line 68 in src/markd/rules/list.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [18/10]
Raw output
> private def parse_list_marker(parser : Parser, container : Node) : Node::DataType
^
Check notice on line 11 in src/markd/rules/list.cr
github-actions / Ameba
Style/NegatedConditionsInUnless
Avoid negated conditions in unless blocks
Raw output
> return MatchValue::None unless data && !data.empty?
^
Check notice on line 146 in src/markd/rules/list.cr
github-actions / Ameba
Style/NegatedConditionsInUnless
Avoid negated conditions in unless blocks
Raw output
> break unless !container.last_line_checked? && container.type.in?(Node::Type::List, Node::Type::Item)
^
Check notice on line 9 in src/markd/rules/list.cr
github-actions / Ameba
Style/ParenthesesAroundCondition
Redundant parentheses
Raw output
> if (!parser.indented || container.type.list?)
^
Check warning on line 225 in src/markd/renderers/html_renderer.cr
github-actions / Ameba
Lint/MissingBlockArgument
Missing anonymous block argument. Use `&` as an argument name to indicate yielding method.
Raw output
> private def tag(name : String, attrs = nil)
^
Check warning on line 253 in src/markd/parsers/inline.cr
github-actions / Ameba
Lint/NotNil
Avoid using `not_nil!`
Raw output
> child.data["destination"] = dest.not_nil!
^
Check warning on line 753 in src/markd/parsers/inline.cr
github-actions / Ameba
Lint/NotNil
Avoid using `not_nil!`
Raw output
> @pos += match.byte_end.not_nil!
^
Check warning on line 31 in src/markd/parsers/inline.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [14/10]
Raw output
> private def process_line(node : Node)
^
Check warning on line 180 in src/markd/parsers/inline.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [23/10]
Raw output
> private def close_bracket(node : Node)
^
Check warning on line 285 in src/markd/parsers/inline.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [31/10]
Raw output
> private def process_emphasis(delimiter : Delimiter?)
^
Check warning on line 596 in src/markd/parsers/inline.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [22/10]
Raw output
> private def scan_delims(char : Char)
^