openjaf/cenit

View on GitHub

Showing 829 of 829 total issues

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

    def process_http_connection(connection, template_parameters, verbose_response, last_response, options, &block)
Severity: Minor
Found in app/models/concerns/setup/webhook_common.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if schema['type'] == 'object' && base_model['type'] != 'object'
                    schema['properties'] ||= {}
                    value_schema = schema['properties']['value'] || {}
                    value_schema = base_model.deep_merge(value_schema)
                    schema['properties']['value'] = value_schema.merge('title' => 'Value', 'xml' => { 'content' => true })
    Severity: Major
    Found in app/models/setup/schema_handler.rb - About 45 mins to fix

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

          def check
            if super
              errors.add(:client, 'provider is not OAuth 2.0 compatible') unless provider.is_a?(Setup::Oauth2Provider)
              scopes.each do |scope|
                next if scope.provider == provider
      Severity: Minor
      Found in app/models/setup/oauth2_authorization.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

      Avoid deeply nested control flow statements.
      Open

                        value.delete(k) unless v.is_a?(Hash)
      Severity: Major
      Found in app/models/setup/mapping_converter.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      if scheduler
                        notify(
                          message: "Detached from scheduler #{scheduler.custom_title} due to overflow cyclic executions",
                          type: :warning
                        )
        Severity: Major
        Found in app/models/setup/flow_execution.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                        fail "contains an unresolved reference #{ref}" unless options[:silent]
          Severity: Major
          Found in app/models/setup/schema_handler.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        base_model = find_ref_schema(base_model) if base_model.is_a?(String)
            Severity: Major
            Found in app/models/setup/schema_handler.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                              value = existing_value.deep_merge(value) { |_, sch_value, ref_value| Cenit::Utility.array_hash_merge(sch_value, ref_value) } if value.is_a?(Hash)
              Severity: Major
              Found in app/models/setup/schema_handler.rb - About 45 mins to fix

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

                    def run(message)
                      if (app = agent_from_msg)
                        app_module = app.app_module
                        if (tenant = app.tenant)
                          begin
                Severity: Minor
                Found in app/models/setup/build_in_app_reinstall.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

                Avoid deeply nested control flow statements.
                Open

                                  value.delete(k) unless v.is_a?(String)
                Severity: Major
                Found in app/models/setup/mapping_converter.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              schema = { 'properties' => base_properties }.deep_merge(schema) do |_, ref_value, sch_value|
                                Cenit::Utility.array_hash_merge(ref_value, sch_value)
                              end unless base_properties.blank?
                  Severity: Major
                  Found in app/models/setup/schema_handler.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                schema['extends'] = base_model['extends'] if base_model['extends']
                    Severity: Major
                    Found in app/models/setup/schema_handler.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                      value += existing_value if value.is_a?(Array)
                      Severity: Major
                      Found in app/models/setup/schema_handler.rb - About 45 mins to fix

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

                            def field_triggers_apply_to?(field, obj_now, obj_before = nil)
                              r = true
                              triggers_hash = JSON.parse(send(field))
                              triggers_hash.each do |field_name, conditions|
                                # LEGACY: Transform form old Hash conditions format to new Array conditions format.
                        Severity: Minor
                        Found in app/models/setup/triggers_formatter.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

                        Avoid deeply nested control flow statements.
                        Open

                                          enum = (limit ? model.limit(limit) : model.all).skip(offset).to_enum
                        Severity: Major
                        Found in app/models/setup/legacy_translator.rb - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          value.delete(k) if v.empty?
                          Severity: Major
                          Found in app/models/setup/mapping_converter.rb - About 45 mins to fix

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

                                def check_snippet
                                  if snippet_required?
                                    configure_snippet
                                    if snippet_ref.changed? && !snippet_ref.save
                                      snippet_ref.errors.full_messages.each do |msg|
                            Severity: Minor
                            Found in app/models/concerns/setup/snippet_code.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

                            Avoid deeply nested control flow statements.
                            Open

                                        next unless (base_properties = base_model['properties'])
                            Severity: Major
                            Found in app/models/setup/schema_handler.rb - About 45 mins to fix

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

                                    def build_in_provider_id
                                      unless @build_in_provider_id
                                        basic_attrs = {
                                          namespace: 'Cenit',
                                          name: 'OAuth',
                              Severity: Minor
                              Found in app/models/setup/oauth2_provider.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

                              Avoid deeply nested control flow statements.
                              Open

                                              next unless step_count >= step_size
                              Severity: Major
                              Found in app/models/setup/deletion.rb - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language