zammad/zammad

View on GitHub

Showing 4,240 of 4,240 total issues

Method aggs has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.aggs(params_origin)
    params = params_origin.dup

    result = []
    case params[:interval]
Severity: Minor
Found in lib/report/ticket_first_solution.rb - About 1 hr to fix

    Method session has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def session(collections, assets, user)
    
        # all ticket stuff
        collections[ Ticket::StateType.to_app_model ] = []
        Ticket::StateType.all.each do |item|
    Severity: Minor
    Found in lib/session_helper/collection_ticket.rb - About 1 hr to fix

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

        def run
          return super if super
      
          return if !check_chat_session_exists
      
      
      Severity: Minor
      Found in lib/sessions/event/chat_session_close.rb - About 1 hr to fix

        Function useStickyHeader has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useStickyHeader = (
          dependencies: WatchSource[] = [],
          header = ref<InstanceType<typeof LayoutHeader> | HTMLElement>(),
        ) => {
          const { y, directions } = useScroll(window.document, {
        Severity: Minor
        Found in app/frontend/shared/composables/useStickyHeader.ts - About 1 hr to fix

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

                      if (this.options.imageWidth == 'absolute') {
                        img = "<img tabindex=\"0\" style=\"width: " + width + "px; max-width: 100%;\" src=\"" + result + "\">"
                      }
                      else {
                        img = "<img tabindex=\"0\" style=\"width: 100%; max-width: " + width + "px;\" src=\"" + result + "\">"
          app/assets/javascripts/app/lib/base/jquery.contenteditable.js on lines 471..476

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

          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

                              else if (y1 <= axisy.min && y2 <= axisy.min) {
                                  ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));
                                  ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));
                                  continue;
                              }
          Severity: Major
          Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1884..1893

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

          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 (y1 >= axisy.max && y2 >= axisy.max) {
                                  ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));
                                  ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));
                                  continue;
                              }
          Severity: Major
          Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1889..1893

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

          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

                      "transition.bounceRightIn": {
                          defaultDuration: 750,
                          calls: [
                              [ { opacity: [ 1, 0 ], translateX: [ -30, 1250 ] }, 0.60, { easing: "easeOutCirc" } ],
                              [ { translateX: 10 }, 0.20 ],
          Severity: Major
          Found in app/assets/javascripts/app/lib/animations/velocity.ui.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/app/lib/animations/velocity.ui.js on lines 464..471

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

          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

                    if (this.options.imageWidth == 'absolute') {
                      img = "<img tabindex=\"0\" style=\"width: " + width + "px; max-width: 100%;\" src=\"" + result + "\">"
                    }
                    else {
                      img = "<img tabindex=\"0\" style=\"width: 100%; max-width: " + width + "px;\" src=\"" + result + "\">"
          app/assets/javascripts/app/lib/base/jquery.contenteditable.js on lines 374..379

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

          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

                      "transition.bounceUpIn": {
                          defaultDuration: 800,
                          calls: [
                              [ { opacity: [ 1, 0 ], translateY: [ -30, 1000 ] }, 0.60, { easing: "easeOutCirc" } ],
                              [ { translateY: 10 }, 0.20 ],
          Severity: Major
          Found in app/assets/javascripts/app/lib/animations/velocity.ui.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/app/lib/animations/velocity.ui.js on lines 518..525

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

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

            it(`renders focused tags`, () => {
              mountFormField('tags', { label: 'select' })
              cy.get('output')
                .focus()
                .then(() => {
          app/frontend/cypress/shared/components/Form/fields/FieldSelect/select-visuals.cy.ts on lines 73..80
          app/frontend/cypress/shared/components/Form/fields/FieldTreeSelect/treeselect-visuals.cy.ts on lines 85..92

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

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

            it(`renders focused treeselect`, () => {
              mountFormField('treeselect', { label: 'treeselect' })
              cy.get('output')
                .focus()
                .then(() => {
          app/frontend/cypress/shared/components/Form/fields/FieldSelect/select-visuals.cy.ts on lines 73..80
          app/frontend/cypress/shared/components/Form/fields/FieldTags/tags-visuals.cy.ts on lines 42..49

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

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

            it(`renders focused select`, () => {
              mountFormField('select', { label: 'select' })
              cy.get('output')
                .focus()
                .then(() => {
          app/frontend/cypress/shared/components/Form/fields/FieldTags/tags-visuals.cy.ts on lines 42..49
          app/frontend/cypress/shared/components/Form/fields/FieldTreeSelect/treeselect-visuals.cy.ts on lines 85..92

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

          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 create has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            create(context) {
              const visitor =
                context.parserServices?.defineTemplateBodyVisitor ||
                ((obj1, obj2) => ({ ...obj1, ...obj2 }))
          
          
          Severity: Minor
          Found in .eslint-plugin-zammad/lib/rules/zammad-tailwind-ltr.js - About 1 hr to fix

            Function insertAxisLabels has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function insertAxisLabels() {
                        placeholder.find(".tickLabels").remove();
                        
                        var html = ['<div class="tickLabels" style="font-size:smaller">'];
            
            
            Severity: Minor
            Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

              Function setupGrid has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function setupGrid() {
                          var i, axes = allAxes();
              
                          // first calculate the plot and axis box dimensions
              
              
              Severity: Minor
              Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

                Function updateDoc has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function updateDoc(doc, change, markedSpans, estimateHeight) {
                    function spansFor(n) {return markedSpans ? markedSpans[n] : null}
                    function update(line, text, spans) {
                      updateLine(line, text, spans, estimateHeight);
                      signalLater(line, "change", line, change);
                Severity: Minor
                Found in app/assets/javascripts/app/lib/base/codemirror.js - About 1 hr to fix

                  Function limitCropBox has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      limitCropBox: function (size, position) {
                        var options = this.options;
                        var strict = options.strict;
                        var container = this.container;
                        var containerWidth = container.width;
                  Severity: Minor
                  Found in app/assets/javascripts/app/lib/base/cropper.js - About 1 hr to fix

                    Function backdrop has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      Modal.prototype.backdrop = function (callback) {
                        var that = this
                        var animate = this.$element.hasClass('fade') ? 'fade' : ''
                    
                        if (this.isShown && this.options.backdrop) {
                    Severity: Minor
                    Found in app/assets/javascripts/app/lib/bootstrap/modal.js - About 1 hr to fix

                      Function close has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              close: function() {
                      
                                  if(this.closed) return;
                                  if(this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language