zammad/zammad

View on GitHub

Showing 4,240 of 4,240 total issues

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

  def self.organization(domain)
    raise Exceptions::UnprocessableEntity, 'no domain given' if domain.blank?

    return if Rails.env.test? && DISABLE_IN_TEST_ENV

Severity: Minor
Found in lib/service/image/zammad.rb - About 1 hr to fix

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

      def self.after_update(record)
    
        # return if we run import mode
        return true if Setting.get('import_mode')
    
    
    Severity: Minor
    Found in lib/transaction_dispatcher.rb - About 1 hr to fix

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

        def self.selectors(index, selectors = nil, options = {}, aggs_interval = nil)
          raise 'no selectors given' if !selectors
      
          url = build_url(type: index, action: '_search', with_pipeline: false, with_document_type: false)
          return if url.blank?
      Severity: Minor
      Found in lib/search_index_backend.rb - About 1 hr to fix

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

              def initialize_article_types
                @article_types = {
                  'email-external' => {
                    type_id:  article_type_id_lookup('email'),
                    internal: false
        Severity: Minor
        Found in lib/import/otrs/article.rb - About 1 hr to fix

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

            def run
          
              if !@session || !@session['id']
                return {
                  event: 'who_am_i',
          Severity: Minor
          Found in lib/sessions/event/who_am_i.rb - About 1 hr to fix

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

              def run
                return super if super
                return if !permission_check('chat.agent', 'chat')
            
                # find chat session
            Severity: Minor
            Found in lib/sessions/event/chat_transfer.rb - About 1 hr to fix

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

                def self.time_max(data)
                  query, bind_params, tables = Ticket.selector2sql(data[:condition])
                  ticket_list = Ticket.where('tickets.created_at >= ? AND tickets.created_at <= ?', data[:start], data[:end])
                                      .where(query, *bind_params).joins(tables)
                  time_max = 0
              Severity: Minor
              Found in lib/report/base.rb - About 1 hr to fix

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

                  def load
                
                    # get whole collection
                    index_and_lists = nil
                    local_overview_changed = overview_changed?
                Severity: Minor
                Found in lib/sessions/backend/ticket_overview_list.rb - About 1 hr to fix

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

                    def self.time_min(data)
                      query, bind_params, tables = Ticket.selector2sql(data[:condition])
                      ticket_list = Ticket.where('tickets.created_at >= ? AND tickets.created_at <= ?', data[:start], data[:end])
                                          .where(query, *bind_params).joins(tables)
                      time_min = 0
                  Severity: Minor
                  Found in lib/report/base.rb - About 1 hr to fix

                    Function mockOnlineNotification has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const mockOnlineNotification = (
                      id: Scalars['ID']['output'],
                      mockNotification: Partial<OnlineNotificationNode>,
                    ): OnlineNotificationNode => {
                      return {

                      Function addStaticFloatingLabel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const addStaticFloatingLabel = (classes: Classes = {}): Classes => {
                        return extendClasses(classes, {
                          outer: clean(`
                            focus-within:bg-blue-highlight relative flex flex-col
                            px-2

                        Function addFloatingTextareaLabel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const addFloatingTextareaLabel = (classes: Classes = {}) => {
                          return extendClasses(classes, {
                            outer: clean(`
                              floating-textarea relative px-2
                            `),

                          Function setPopulatedOnWebkitAutofill has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const setPopulatedOnWebkitAutofill = (node: FormKitNode) => {
                            let autofillField = false
                          
                            const onAnimationstart = (e?: AnimationEvent) => {
                              if (
                          Severity: Minor
                          Found in app/frontend/shared/form/features/setPopulatedOnWebkitAutofill.ts - About 1 hr to fix

                            Function formUpdaterTrigger has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const formUpdaterTrigger = (
                              defaultTrigger: FormUpdaterTrigger = 'direct',
                              defaultTriggerDelay = 300,
                            ) => {
                              return (node: FormKitNode) => {
                            Severity: Minor
                            Found in app/frontend/shared/form/features/formUpdaterTrigger.ts - About 1 hr to fix

                              Function getArticleAttachmentsLinks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const getArticleAttachmentsLinks = (
                                attachment: Attachment,
                                config: ConfigList,
                              ) => {
                                const buildBaseUrl = () => {

                                Function messageText has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const messageText = (
                                  type: string,
                                  authorName: string,
                                  metaObject?: DataPrivacyTask,
                                ): Maybe<string> => {

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def extract_from_string(string, filename)
                                      return if string.empty?
                                  
                                      # display: '...'
                                      literal_string_regex = %r{('|")(.+?)(?<!\\)\1}
                                  lib/generators/zammad/translation_catalog/extractor/chat.rb on lines 6..18

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 48.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def extract_from_string(string, filename)
                                      return if string.empty?
                                  
                                      # title: '...'
                                      # scrollHint: '...'
                                  Severity: Major
                                  Found in lib/generators/zammad/translation_catalog/extractor/chat.rb and 1 other location - About 1 hr to fix
                                  lib/generators/zammad/translation_catalog/extractor/form_js.rb on lines 6..17

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 48.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Function resizeImage has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      ZammadChat.prototype.resizeImage = function(dataURL, x, y, sizeFactor, type, quallity, callback, force) {
                                  Severity: Major
                                  Found in public/assets/chat/chat-no-jquery.js - About 1 hr to fix

                                    Function plotPoints has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                                function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
                                    Severity: Major
                                    Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language