thooams/ui_bibz

View on GitHub
lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
97%

Class DatePickerField has 24 methods (exceeds 20 allowed). Consider refactoring.
Wontfix

  class DatePickerField < UiBibz::Ui::Core::Component
    # See UiBibz::Ui::Core::Component.initialize

    # Render html tag
    def pre_render
Severity: Minor
Found in lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb - About 2 hrs to fix

Method date_picker_field_html_tag has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Wontfix

    def date_picker_field_html_tag
      if options[:range]
        UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new(class: 'input-daterange').tap do |sf|
          sf.addon @options[:append] unless @options[:append].nil?
          sf.text_field content[0], nil, html_options
Severity: Minor
Found in lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb - About 1 hr to fix

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

There are no issues that match your filters.

Category
Status