zammad/zammad

View on GitHub

Showing 4,240 of 4,240 total issues

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

    const fieldResolver = new FieldResolverTreeselect(
      EnumObjectManagerObjects.Ticket,
      {
        dataType: 'treeselect',
        name: 'category',
app/frontend/shared/entities/object-attributes/form/resolver/fields/__tests__/select.spec.ts on lines 66..81

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

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

  it('check for customer permission and setting customer ticket create enabled', () => {
    mockPermissions(['ticket.customer'])
    mockApplicationConfig({
      customer_ticket_create: true,
    })
app/frontend/shared/entities/ticket/composables/__tests__/useTicketCreate.spec.ts on lines 8..17
app/frontend/shared/entities/ticket/composables/__tests__/useTicketCreate.spec.ts on lines 19..28
app/frontend/shared/entities/ticket/composables/__tests__/useTicketCreate.spec.ts on lines 41..50

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

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

export type KeyComplexValue = {
  __typename?: 'KeyComplexValue';
  key: Scalars['String']['output'];
  value?: Maybe<Scalars['JSON']['output']>;
};
Severity: Major
Found in app/frontend/shared/graphql/types.ts and 1 other location - About 1 hr to fix
app/frontend/shared/graphql/types.ts on lines 883..887

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

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

      state_id: {
        show: true,
        options: [
          { value: 4, label: 'closed' },
          { value: 2, label: 'open' },
app/frontend/apps/mobile/pages/ticket/__tests__/ticket-information-update.spec.ts on lines 77..86

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

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

export type KeyValue = {
  __typename?: 'KeyValue';
  key: Scalars['String']['output'];
  value?: Maybe<Scalars['String']['output']>;
};
Severity: Major
Found in app/frontend/shared/graphql/types.ts and 1 other location - About 1 hr to fix
app/frontend/shared/graphql/types.ts on lines 876..880

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

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

      {
        name: 'heading',
        contentType: ['text/html'],
        label: i18n.t('Add first level heading'),
        icon: 'text-style-h1',
app/frontend/shared/components/Form/fields/FieldEditor/useEditorActions.ts on lines 162..171
app/frontend/shared/components/Form/fields/FieldEditor/useEditorActions.ts on lines 172..181

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

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

        function drawSeriesPoints(series) {
            function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
                var points = datapoints.points, ps = datapoints.pointsize;

                for (var i = 0; i < points.length; i += ps) {
Severity: Minor
Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

        function getImageData(img, callback) {
            function handleBinaryFile(binFile) {
                var data = findEXIFinJPEG(binFile);
                var iptcdata = findIPTCinJPEG(binFile);
                img.exifdata = data || {};
    Severity: Minor
    Found in app/assets/javascripts/app/lib/base/exif.js - About 1 hr to fix

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

                      function drawLabels()
                      {
                          var currentAngle = startAngle;
                          
                          // set radius
      Severity: Minor
      Found in app/assets/javascripts/app/lib/flot/jquery.flot.pie.js - About 1 hr to fix

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

          ContentEditableInput.prototype.showPrimarySelection = function () {
            var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();
            var from = prim.from(), to = prim.to();
        
            if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {
        Severity: Minor
        Found in app/assets/javascripts/app/lib/base/codemirror.js - About 1 hr to fix

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

          function inputToRGB(color) {
          
              var rgb = { r: 0, g: 0, b: 0 };
              var a = 1;
              var s = null;
          Severity: Minor
          Found in app/assets/javascripts/app/lib/base/tinycolor.js - About 1 hr to fix

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

                $.fn.visible = function(partial,hidden,direction){
            
                    if (this.length < 1)
                        return;
            
            
            Severity: Minor
            Found in app/assets/javascripts/app/lib/base/jquery.visible.js - About 1 hr to fix

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

                  $.fn[ name ] = function( options ) {
                      var isMethodCall = typeof options === "string",
                          args = widget_slice.call( arguments, 1 ),
                          returnValue = this;
              
              
              Severity: Minor
              Found in app/assets/javascripts/app/lib/core/jquery-ui-1.11.4.js - About 1 hr to fix

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

                  Mention.renderResults = function(textmodule, term) {
                    textmodule.emptyResultsContainer()
                
                    // skip in admin interface (ticket is needed)
                    if (!textmodule.searchCondition) {
                Severity: Minor
                Found in app/assets/javascripts/app/lib/base/jquery.textmodule.js - About 1 hr to fix

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

                      refresh: function() {
                          var menus, items,
                              that = this,
                              icon = this.options.icons.submenu,
                              submenus = this.element.find( this.options.menus );
                  Severity: Minor
                  Found in app/assets/javascripts/app/lib/core/jquery-ui-1.11.4.js - About 1 hr to fix

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

                        var Datepicker = function(element, options){
                            this._process_options(options);
                    
                            this.dates = new DateArray();
                            this.viewDate = this.o.defaultViewDate;
                    Severity: Minor
                    Found in app/assets/javascripts/app/lib/bootstrap/bootstrap-datepicker.js - About 1 hr to fix

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

                      jQuery.extend = jQuery.fn.extend = function() {
                          var options, name, src, copy, copyIsArray, clone,
                              target = arguments[ 0 ] || {},
                              i = 1,
                              length = arguments.length,
                      Severity: Minor
                      Found in app/assets/javascripts/app/lib/core/jquery-3.6.0.js - About 1 hr to fix

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

                          def perform(article_id)
                            article = Ticket::Article.find(article_id)
                        
                            # set retry count
                            article.preferences['delivery_retry'] ||= 0
                        Severity: Minor
                        Found in app/jobs/communicate_facebook_job.rb - About 1 hr to fix

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

                            def sync(without_save = nil)
                              return if !ical_url
                          
                              # only sync every 5 days
                              if id
                          Severity: Minor
                          Found in app/models/calendar.rb - About 1 hr to fix

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

                              def user_device_log(user = current_user, type = 'session')
                                switched_from_user_id = ENV['SWITCHED_FROM_USER_ID'] || session[:switched_from_user_id]
                                return true if %w[init mobile].include?(params[:controller]) # do no device logging on static initial page
                                return true if switched_from_user_id
                                return true if current_user_on_behalf # do no device logging for the user on behalf feature
                            Severity: Minor
                            Found in app/controllers/application_controller/handles_devices.rb - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language