zammad/zammad

View on GitHub

Showing 2,071 of 4,482 total issues

File underscore-1.8.3.js has 1071 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//     Underscore.js 1.8.3
//     http://underscorejs.org
//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.

Severity: Major
Found in app/assets/javascripts/app/lib/core/underscore-1.8.3.js - About 2 days to fix

    File FieldAutoComplete.spec.ts has 1061 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
    
    import { getNode } from '@formkit/core'
    import { FormKit } from '@formkit/vue'
    import {

      File FieldSelect.spec.ts has 1010 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
      
      import { getNode } from '@formkit/core'
      import { FormKit } from '@formkit/vue'
      import { getByText, waitFor } from '@testing-library/vue'

        File bootstrap-timepicker.js has 995 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
         * Timepicker Component for Twitter Bootstrap
         *
         * Copyright 2013 Joris de Wit
         *
        Severity: Major
        Found in app/assets/javascripts/app/lib/bootstrap/bootstrap-timepicker.js - About 2 days to fix

          Function init has 495 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function init(plot) // this is the "body" of the plugin
              {
                  var canvas = null;
                  var target = null;
                  var maxRadius = null;
          Severity: Major
          Found in app/assets/javascripts/app/lib/flot/jquery.flot.pie.js - About 2 days to fix

            Function QrCode has 454 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var QrCode = /** @class */ (function () {
                    /*-- Constructor (low level) and fields --*/
                    // Creates a new QR Code with the given version number,
                    // error correction level, data codeword bytes, and mask number.
                    // This is a low-level API that most users should not use directly.
            Severity: Major
            Found in app/assets/javascripts/app/lib/base/qrcodegen.js - About 2 days to fix

              File marked.js has 912 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * marked - a markdown parser
               * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
               * https://github.com/chjj/marked
               */
              Severity: Major
              Found in app/assets/javascripts/app/lib/base/marked.js - About 2 days to fix

                File tinycolor.js has 902 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // TinyColor v1.4.1
                // https://github.com/bgrins/TinyColor
                // Brian Grinstead, MIT License
                
                (function(Math) {
                Severity: Major
                Found in app/assets/javascripts/app/lib/base/tinycolor.js - About 2 days to fix

                  File jquery.noty.js has 876 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  !function(root, factory) {
                       if (typeof define === 'function' && define.amd) {
                           define(['jquery'], factory);
                       } else if (typeof exports === 'object') {
                           module.exports = factory(require('jquery'));
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 2 days to fix

                    File attribute.rb has 831 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    class ObjectManager::Attribute < ApplicationModel
                      include HasDefaultModelUserRelations
                    
                      include ChecksClientNotification
                      include CanSeed
                    Severity: Major
                    Found in app/models/object_manager/attribute.rb - About 1 day to fix

                      Method csv_import has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def csv_import(data)
                            try    = data[:try].to_s == 'true'
                            delete = data[:delete].to_s == 'true'
                      
                            begin
                      Severity: Minor
                      Found in app/models/concerns/can_csv_import.rb - About 1 day 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

                      Function addEditorMethods has 378 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function addEditorMethods(CodeMirror) {
                          var optionHandlers = CodeMirror.optionHandlers;
                      
                          var helpers = CodeMirror.helpers = {};
                      
                      
                      Severity: Major
                      Found in app/assets/javascripts/app/lib/base/codemirror.js - About 1 day to fix

                        Method association_name_to_id_convert has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def association_name_to_id_convert(params)
                        
                              if params.respond_to?(:permit!)
                                params = params.permit!.to_h
                              end
                        Severity: Minor
                        Found in app/models/application_model/can_associations.rb - About 1 day 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

                        File email-addresses.js has 775 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        
                        // email-addresses.js - RFC 5322 email address parser
                        // v 3.0.1
                        //
                        // http://tools.ietf.org/html/rfc5322
                        Severity: Major
                        Found in app/assets/javascripts/app/lib/base/email-addresses.js - About 1 day to fix

                          File search_index_backend.rb has 765 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          class SearchIndexBackend
                          
                            SUPPORTED_ES_VERSION_MINIMUM   = '7.8'.freeze
                            SUPPORTED_ES_VERSION_LESS_THAN = '9'.freeze
                          
                          
                          Severity: Major
                          Found in lib/search_index_backend.rb - About 1 day to fix

                            File email_parser.rb has 764 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            class Channel::EmailParser
                              include Channel::EmailHelper
                            
                              PROCESS_TIME_MAX = 180
                              EMAIL_REGEX = %r{.+@.+}
                            Severity: Major
                            Found in app/models/channel/email_parser.rb - About 1 day to fix

                              File twitter_sync.rb has 762 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              require 'http/uri'
                              
                              class TwitterSync
                              
                                STATUS_URL_TEMPLATE = 'https://twitter.com/_/status/%s'.freeze
                              Severity: Major
                              Found in lib/twitter_sync.rb - About 1 day to fix

                                Function jsonlint has 357 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                var jsonlint = (function(){
                                var parser = {trace: function trace() { },
                                yy: {},
                                symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
                                terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
                                Severity: Major
                                Found in app/assets/javascripts/app/lib/base/jsonlint.js - About 1 day to fix

                                  File user.rb has 733 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  class User < ApplicationModel
                                    include CanBeImported
                                    include HasActivityStreamLog
                                    include ChecksClientNotification
                                    include HasHistory
                                  Severity: Major
                                  Found in app/models/user.rb - About 1 day to fix

                                    File guided-setup-manual-channel-email.spec.ts has 727 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
                                    
                                    import { getNode } from '@formkit/core'
                                    import {
                                      getByLabelText,
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language