zammad/zammad

View on GitHub

Showing 4,240 of 4,240 total issues

Function absoluteDateTime has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const absoluteDateTime = (
  dateTimeString: string,
  template: string,
): string => {
  let date = new Date(dateTimeString)
Severity: Minor
Found in app/frontend/shared/i18n/dates.ts - About 1 hr to fix

    Function getArticleSelection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getArticleSelection = (articleId: number) => {
      const selection = window.getSelection()
      if (!selection || selection.rangeCount <= 0) return undefined
      const range = selection.getRangeAt(0)
      const articleContent = document.querySelector(

      Function renderList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const renderList = () => {
          const listExposed = ref<{
            onKeyDown: (e: any) => void
          }>()
          const command = vi.fn()

        Function addTypes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          addTypes(ticket) {
            const descriptionType = ticket.createArticleType?.name
        
            if (descriptionType !== 'telegram personal-message') return []
        
        

          Function initializeStoreSubscriptions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function initializeStoreSubscriptions(): void {
            const session = useSessionStore()
            const locale = useLocaleStore()
            const application = useApplicationStore()
          
          
          Severity: Minor
          Found in app/frontend/shared/initializer/storeSubscriptions.ts - About 1 hr to fix

            Function useTraverseOptions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const useTraverseOptions = (
              container: MaybeRefOrGetter<HTMLElement | undefined | null>,
              options: TraverseOptions = {},
            ) => {
              options.scrollIntoView ??= true
            Severity: Minor
            Found in app/frontend/shared/composables/useTraverseOptions.ts - About 1 hr to fix

              Function fields has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const fields = computed<AttributeField[]>(() => {
                  return options.attributes
                    .map((attribute) => {
                      let value = getValue(attribute.name)
              
              

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

                    ZammadChat.prototype.onLeaveTemporary = function() {
                      if (!this.sessionId) {
                        return;
                      }
                      return this.send('chat_session_leave_temporary', {
                Severity: Major
                Found in public/assets/chat/chat-no-jquery.js and 1 other location - About 1 hr to fix
                public/assets/chat/chat.js on lines 2107..2114

                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 56.

                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

                        marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
                Severity: Major
                Found in app/assets/javascripts/app/lib/base/codemirror.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/app/lib/base/codemirror.js on lines 11144..11144

                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 56.

                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

                        if (res = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))
                            return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10));
                Severity: Major
                Found in app/assets/javascripts/app/lib/flot/jquery.colorhelpers.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/app/lib/flot/jquery.colorhelpers.js on lines 116..117

                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 56.

                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

                            if (!this.containers[innermostIndex].containerCache.over) {
                                this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
                                this.containers[innermostIndex].containerCache.over = 1;
                            }
                Severity: Major
                Found in app/assets/javascripts/app/lib/core/jquery-ui-1.11.4.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/app/lib/core/jquery-ui-1.11.4.js on lines 3925..3928

                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 56.

                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

                        if (res = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))
                            return m(parseInt(res[1], 16), parseInt(res[2], 16), parseInt(res[3], 16));
                Severity: Major
                Found in app/assets/javascripts/app/lib/flot/jquery.colorhelpers.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/app/lib/flot/jquery.colorhelpers.js on lines 100..101

                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 56.

                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

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

                    ZammadChat.prototype.onLeaveTemporary = function() {
                      if (!this.sessionId) {
                        return;
                      }
                      return this.send('chat_session_leave_temporary', {
                Severity: Major
                Found in public/assets/chat/chat.js and 1 other location - About 1 hr to fix
                public/assets/chat/chat-no-jquery.js on lines 2132..2139

                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 56.

                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

                          marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
                Severity: Major
                Found in app/assets/javascripts/app/lib/base/codemirror.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/app/lib/base/codemirror.js on lines 11142..11142

                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 56.

                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

                                if(this.containers[i].containerCache.over) {
                                    this.containers[i]._trigger("out", event, this._uiHash(this));
                                    this.containers[i].containerCache.over = 0;
                                }
                Severity: Major
                Found in app/assets/javascripts/app/lib/core/jquery-ui-1.11.4.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/app/lib/core/jquery-ui-1.11.4.js on lines 3940..3943

                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 56.

                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 5 locations. Consider refactoring.
                Open

                      case params[:interval]
                      when 'month'
                        params[:range_end] = params[:range_start].next_month
                      when 'week', 'day'
                        params[:range_end] = params[:range_start].next_day
                Severity: Major
                Found in lib/report/ticket_moved.rb and 4 other locations - About 1 hr to fix
                lib/report/article_by_type_sender.rb on lines 46..54
                lib/report/ticket_first_solution.rb on lines 37..45
                lib/report/ticket_generic_time.rb on lines 98..106
                lib/report/ticket_reopened.rb on lines 39..47

                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 49.

                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 5 locations. Consider refactoring.
                Open

                        case params[:interval]
                        when 'month'
                          params[:range_start] = params[:range_start].next_month
                        when 'week', 'day'
                          params[:range_start] = params[:range_start].next_day
                Severity: Major
                Found in lib/report/ticket_generic_time.rb and 4 other locations - About 1 hr to fix
                lib/report/article_by_type_sender.rb on lines 46..54
                lib/report/ticket_first_solution.rb on lines 37..45
                lib/report/ticket_moved.rb on lines 45..53
                lib/report/ticket_reopened.rb on lines 39..47

                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 49.

                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 5 locations. Consider refactoring.
                Open

                      case params[:interval]
                      when 'month'
                        params[:range_end] = params[:range_start].next_month
                      when 'week', 'day'
                        params[:range_end] = params[:range_start].next_day
                Severity: Major
                Found in lib/report/article_by_type_sender.rb and 4 other locations - About 1 hr to fix
                lib/report/ticket_first_solution.rb on lines 37..45
                lib/report/ticket_generic_time.rb on lines 98..106
                lib/report/ticket_moved.rb on lines 45..53
                lib/report/ticket_reopened.rb on lines 39..47

                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 49.

                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 5 locations. Consider refactoring.
                Open

                      case params[:interval]
                      when 'month'
                        params[:range_end] = params[:range_start].next_month
                      when 'week', 'day'
                        params[:range_end] = params[:range_start].next_day
                Severity: Major
                Found in lib/report/ticket_reopened.rb and 4 other locations - About 1 hr to fix
                lib/report/article_by_type_sender.rb on lines 46..54
                lib/report/ticket_first_solution.rb on lines 37..45
                lib/report/ticket_generic_time.rb on lines 98..106
                lib/report/ticket_moved.rb on lines 45..53

                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 49.

                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 5 locations. Consider refactoring.
                Open

                      case params[:interval]
                      when 'month'
                        params[:range_end] = params[:range_start].next_month
                      when 'week', 'day'
                        params[:range_end] = params[:range_start].next_day
                Severity: Major
                Found in lib/report/ticket_first_solution.rb and 4 other locations - About 1 hr to fix
                lib/report/article_by_type_sender.rb on lines 46..54
                lib/report/ticket_generic_time.rb on lines 98..106
                lib/report/ticket_moved.rb on lines 45..53
                lib/report/ticket_reopened.rb on lines 39..47

                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 49.

                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

                Severity
                Category
                Status
                Source
                Language