zammad/zammad

View on GitHub

Showing 4,422 of 4,422 total issues

Function data has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    data: function( key, value ) {
        var i, name, data,
            elem = this[ 0 ],
            attrs = elem && elem.attributes;

Severity: Minor
Found in app/assets/javascripts/app/lib/core/jquery-3.6.0.js - About 1 hr to fix

    Method url_check has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def url_check
        return if setup_done_response
    
        # validate
        if params[:url].blank? || params[:url] !~ %r{^(http|https)://.+?$}
    Severity: Minor
    Found in app/controllers/import_zendesk_controller.rb - About 1 hr to fix

      Method link_account has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.link_account(_request_token, params)
          #    fail if request_token.params[:oauth_token] != params[:state]
          external_credential = ExternalCredential.find_by(name: 'facebook')
          raise Exceptions::UnprocessableEntity, __('No Facebook app configured!') if !external_credential
      
      
      Severity: Minor
      Found in lib/external_credential/facebook.rb - About 1 hr to fix

        Function useObjectAttributeFormData has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useObjectAttributeFormData = (
          objectAttributes: Map<string, ObjectManagerFrontendAttribute>,
          values: FormValues,
        ) => {
          const internalObjectAttributeValues: Record<string, FormFieldValue> = {}

          Function debugLink has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const debugLink = new ApolloLink((operation, forward) => {
            if (log.getLevel() < log.levels.DEBUG) return forward(operation)
          
            const requestContext = operation.getContext()
          
          
          Severity: Minor
          Found in app/frontend/shared/server/apollo/link/debug.ts - About 1 hr to fix

            Function handleError has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              protected handleError(error: ApolloError): void {
                const options = this.handlerOptions
            
                let triggerNotification = options.errorShowNotification
            
            
            Severity: Minor
            Found in app/frontend/shared/server/apollo/handler/BaseHandler.ts - About 1 hr to fix

              Function schema has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                definition.schema = (extensions) => {
                  let sectionSchemaExtension:
                    | FormKitSchemaCondition
                    | Partial<FormKitSchemaNode>
              
              
              Severity: Minor
              Found in app/frontend/shared/form/utils/extendSchemaDefinition.ts - About 1 hr to fix

                Method perform has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def perform(model)
                    model = model.safe_constantize
                    return if model.blank?
                
                    assets = {}
                Severity: Minor
                Found in app/jobs/collection_update_job.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 filter_matches? has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.filter_matches?(mail, filter)
                
                    min_one_rule_exists = false
                
                    filter[:match].each do |key, meta|
                Severity: Minor
                Found in app/models/channel/filter/database.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 attachments_for_search_index_attribute_lookup has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def attachments_for_search_index_attribute_lookup
                    # list ignored file extensions
                    attachments_ignore = Setting.get('es_attachment_ignore') || [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe' ]
                
                    # max attachment size
                Severity: Minor
                Found in app/models/application_model/has_attachments.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 changed? has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def changed?(object:, current_changes:, previous_changes: {})
                      changed = false
                      previous_changes ||= {}
                      current_changes.each do |attribute, value|
                        next if !object.attributes.key?(attribute.to_s)
                Severity: Minor
                Found in app/models/external_sync.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 assets has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def assets(data)
                
                      app_model_trigger = Trigger.to_app_model
                      data[ app_model_trigger ] ||= {}
                
                
                Severity: Minor
                Found in app/models/trigger/assets.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 assets has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def assets(data)
                
                      app_model = self.class.to_app_model
                
                      if !data[ app_model ]
                Severity: Minor
                Found in app/models/online_notification/assets.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 ticket_set_last_owner_update_time has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def ticket_set_last_owner_update_time
                
                    # return if we run import mode
                    return true if Setting.get('import_mode')
                    # check if owner, state or group has changed
                Severity: Minor
                Found in app/models/ticket/sets_last_owner_update_time.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 selectors has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def selectors(selectors, options = {})
                      limit = options[:limit] || 10
                      current_user = options[:current_user]
                      access = options[:access] || 'full'
                      raise 'no selectors given' if !selectors
                Severity: Minor
                Found in app/models/ticket/can_selector.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 params_all has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def params_all
                    profile = nil
                    if !params[:profiles] && !params[:profile_id]
                      raise Exceptions::UnprocessableEntity, __("Required parameter 'profile' is missing.")
                    end
                Severity: Minor
                Found in app/controllers/reports_controller.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 by_organization has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def by_organization
                    year  = params[:year] || Time.zone.now.year
                    month = params[:month] || Time.zone.now.month
                
                    start_period = Time.zone.parse("#{year}-#{month}-01")
                Severity: Minor
                Found in app/controllers/time_accountings_controller.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 process has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def process
                    state.provide(:ews_folder_id_path_map) do
                
                      ids   = ews_folder_ids
                      ids ||= []
                Severity: Minor
                Found in lib/sequencer/unit/exchange/folders/id_path_map.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 register_webhook has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.register_webhook(params)
                    request_account_to_link(params, false)
                
                    raise Exceptions::UnprocessableEntity, __("The required parameter 'consumer_key' is missing.") if params[:consumer_key].blank?
                    raise Exceptions::UnprocessableEntity, __("The required parameter 'consumer_secret' is missing.") if params[:consumer_secret].blank?
                Severity: Minor
                Found in lib/external_credential/twitter.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 history has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.history(data)
                
                    history_object = History::Object.lookup(name: data[:object])
                
                    query, bind_params, tables = Ticket.selector2sql(data[:selector])
                Severity: Minor
                Found in lib/report/base.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

                Severity
                Category
                Status
                Source
                Language