slovensko-digital/navody.digital

View on GitHub

Showing 53 of 82 total issues

Method next_step has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def next_step
    redirect_to action: :unsupported and return unless @application_form.form_data&.sro?
    redirect_to action: :nothing_missing and return if @application_form.form_data&.all_stakeholders_ok?

    if @application_form.go_back?

    Method place_step has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          private def place_step(listener)
            if go_back?
              self.step = 'permanent_resident'
              listener.render :permanent_resident
            elsif valid?(:place)
    Severity: Minor
    Found in app/models/apps/president_vote_app/application_form.rb - About 1 hr to fix

      Method initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def initialize(cin: nil, json_form_data: nil, form_data: nil, company_municipality: nil,
                             stakeholder_nationality: nil, stakeholder_identifier: nil, stakeholder_other_identifier: nil, stakeholder_other_identifier_type: nil,
                             stakeholder_dob_year: nil, stakeholder_dob_month: nil, stakeholder_dob_day: nil, current_stakeholder_index: -1, stakeholder_municipality: nil,
                             current_step: nil, go_to_summary: false, back: false)
                @cin = cin

        Method run has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def run(listener)
                case step
                when 'start'
                  start_step(listener)
                when 'place'
        Severity: Minor
        Found in app/models/apps/parliament_vote_app/application_form.rb - About 1 hr to fix

          Method collection_check_boxes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {})
              has_errors = @object.errors[method].any?
          
              @template.content_tag(:div, class: 'govuk-form-group' + (has_errors ? ' govuk-form-group--error' : '')) do
                @template.label(:label, method, class: 'govuk-label') +
          Severity: Minor
          Found in app/helpers/admin_form_builder.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

          Method run has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def run(listener)
                  case step
                  when 'start'
                    start_step(listener)
                  when 'place'
          Severity: Minor
          Found in app/models/apps/president_vote_app/application_form.rb - About 1 hr to fix

            Method select has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def select(method, choices = nil, options = {}, html_options = {}, &block)
                has_errors = @object.errors[method].any?
            
                @template.content_tag(:div, class: 'govuk-form-group' + (has_errors ? ' govuk-form-group--error' : '')) do
                  @template.label(:label, method, class: 'govuk-label') +
            Severity: Minor
            Found in app/helpers/admin_form_builder.rb - About 55 mins 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

            Method initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                    def initialize(
                      full_name: nil, cin: nil, foreign: nil, identifier: nil, other_identifier: nil, other_identifier_type: nil,
                      dob_year: nil, dob_month: nil, dob_day: nil,
                      person_formatted_name: nil, person_given_names: nil, person_family_names: nil, person_prefixes: nil, person_postfixes: nil,
                      address_street: nil, address_reg_number: nil, address_building_number: nil, address_postal_code: nil, address_municipality: nil, address_country: nil,
            Severity: Minor
            Found in app/lib/upvs_submissions/forms/fuzs_data.rb - About 55 mins 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

            Method pin_is_ok has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                  private def pin_is_ok
                    return errors.add(:pin, 'Rodné číslo je pocinná položka') if pin.blank?
            
                    begin
                      pin.to_i
            Severity: Minor
            Found in app/models/apps/president_vote_app/application_form.rb - About 55 mins 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

            Method text_field has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def text_field(method, options = {})
                has_errors = @object.errors[method].any?
            
                @template.content_tag(:div, class: 'govuk-form-group' + (has_errors ? ' govuk-form-group--error' : '')) do
                  @template.label(:label, method, class: 'govuk-label') +
            Severity: Minor
            Found in app/helpers/admin_form_builder.rb - About 55 mins 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

            Method pin_is_ok has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                  private def pin_is_ok
                    return errors.add(:pin, 'Rodné číslo je pocinná položka') if pin.blank?
            
                    begin
                      pin.to_i
            Severity: Minor
            Found in app/models/apps/parliament_vote_app/application_form.rb - About 55 mins 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

            Method person has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.person(data, with_identifiers: true)
                <<~PERSON
                  <ns1:Osoba>
                    <ns1:TitulPred>#{data&.prefixes}</ns1:TitulPred>
                    <ns1:Meno>#{data&.given_name}</ns1:Meno>
            Severity: Minor
            Found in app/lib/upvs_submissions/form_builders/fuzs_form_builder.rb - About 55 mins 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

            Method text_area has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def text_area(method, options={})
                has_errors = @object.errors[method].any?
            
                @template.content_tag(:div, class: 'govuk-form-group' + (has_errors ? ' govuk-form-group--error' : '')) do
                  @template.label(:label, method, class: 'govuk-label') +
            Severity: Minor
            Found in app/helpers/admin_form_builder.rb - About 55 mins 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

            Method date_field has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def date_field(method, options={})
                has_errors = @object.errors[method].any?
            
                @template.content_tag(:div, class: 'govuk-form-group' + (has_errors ? ' govuk-form-group--error' : '')) do
                  @template.label(:label, method, class: 'govuk-label') +
            Severity: Minor
            Found in app/helpers/admin_form_builder.rb - About 55 mins 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

            Method collection_select has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
                has_errors = @object.errors[method].any?
            
                @template.content_tag(:div, class: 'govuk-form-group' + (has_errors ? ' govuk-form-group--error' : '')) do
                  @template.label(:label, method, class: 'govuk-label') +
            Severity: Minor
            Found in app/helpers/admin_form_builder.rb - About 55 mins 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

            Method number_field has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def number_field(method, options = {})
                has_errors = @object.errors[method].any?
            
                @template.content_tag(:div, class: 'govuk-form-group' + (has_errors ? ' govuk-form-group--error' : '')) do
                  @template.label(:label, method, class: 'govuk-label') +
            Severity: Minor
            Found in app/helpers/admin_form_builder.rb - About 55 mins 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

            Method fill_submission has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                  def fill_submission
                    (render action: :index and return) if @application_form.corporate_body_invalid?
            
                    if @application_form.go_back?
                      case @application_form.current_step
            Severity: Minor
            Found in app/controllers/apps/acts_or_sr_app/acts_submissions_controller.rb - About 45 mins 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

            Method stakeholder_deposit_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.stakeholder_deposit_data(table)
                names = []
                deposit = []
            
                deposits_line = false
            Severity: Minor
            Found in app/lib/or_sr_record_fetcher.rb - About 45 mins 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

            Method collection_select has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
            Severity: Minor
            Found in app/helpers/admin_form_builder.rb - About 45 mins to fix

              Method initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      def initialize(street: nil, number: nil, building_number: nil, reg_number: nil, original_municipality: nil, municipality: nil, originally_missing_municipality_id: nil, postal_code: nil, country: nil)
                        @street = street
                        registration_number = (reg_number != 0 ? reg_number : nil)
                        @number = number.present? ? number : join_numbers(building_number, registration_number)
                        @postal_code = postal_code
              Severity: Minor
              Found in app/lib/upvs_submissions/forms/fuzs_data.rb - About 45 mins 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

              Severity
              Category
              Status
              Source
              Language