modxcms/revolution

View on GitHub
core/model/modx/modprocessor.class.php

Summary

Maintainability
F
6 days
Test Coverage

File modprocessor.class.php has 887 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 * This file is part of MODX Revolution.
 *
 * Copyright (c) MODX, LLC. All Rights Reserved.
Severity: Major
Found in core/model/modx/modprocessor.class.php - About 2 days to fix

    modProcessor has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class modProcessor {
        /**
         * A reference to the modX object.
         * @var modX $modx
         */
    Severity: Minor
    Found in core/model/modx/modprocessor.class.php - About 2 hrs to fix

      Function __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          function __construct(modX &$modx,$response = array()) {
              $this->modx =& $modx;
              $this->response = $response;
              if ($this->isError()) {
                  if (!empty($response['errors']) && is_array($response['errors'])) {
      Severity: Minor
      Found in core/model/modx/modprocessor.class.php - About 1 hr 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

      Method process has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function process() {
              /* Run the beforeSet method before setting the fields, and allow stoppage */
              $canSave = $this->beforeSet();
              if ($canSave !== true) {
                  return $this->failure($canSave);
      Severity: Minor
      Found in core/model/modx/modprocessor.class.php - About 1 hr to fix

        Function fireBeforeSaveEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function fireBeforeSaveEvent() {
                $preventSave = false;
                if (!empty($this->beforeSaveEvent)) {
                    /** @var boolean|array $OnBeforeFormSave */
                    $OnBeforeFormSave = $this->modx->invokeEvent($this->beforeSaveEvent,array(
        Severity: Minor
        Found in core/model/modx/modprocessor.class.php - About 1 hr 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 fireBeforeSaveEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function fireBeforeSaveEvent() {
                $preventSave = false;
                if (!empty($this->beforeSaveEvent)) {
                    /** @var boolean|array $OnBeforeFormSave */
                    $OnBeforeFormSave = $this->modx->invokeEvent($this->beforeSaveEvent,array(
        Severity: Minor
        Found in core/model/modx/modprocessor.class.php - About 1 hr 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

        Method process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function process() {
                /* Run the beforeSet method before setting the fields, and allow stoppage */
                $canSave = $this->beforeSet();
                if ($canSave !== true) {
                    return $this->failure($canSave);
        Severity: Minor
        Found in core/model/modx/modprocessor.class.php - About 1 hr to fix

          Method process has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function process() {
                  /* Run the beforeSet method before setting the fields, and allow stoppage */
                  $canSave = $this->beforeSet();
                  if ($canSave !== true) {
                      return $this->failure($canSave);
          Severity: Minor
          Found in core/model/modx/modprocessor.class.php - About 1 hr to fix

            Function process has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function process() {
                    /* Run the beforeSet method before setting the fields, and allow stoppage */
                    $canSave = $this->beforeSet();
                    if ($canSave !== true) {
                        return $this->failure($canSave);
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 1 hr 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 process has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function process() {
                    /* Run the beforeSet method before setting the fields, and allow stoppage */
                    $canSave = $this->beforeSet();
                    if ($canSave !== true) {
                        return $this->failure($canSave);
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 1 hr 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 processEventResponse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function processEventResponse($response,$separator = "\n") {
                    if (is_array($response)) {
                        $result = false;
                        foreach ($response as $msg) {
                            if (!empty($msg)) {
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 55 mins 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function initialize() {
                    $primaryKey = $this->getProperty($this->primaryKeyField, false);
                    if (empty($primaryKey)) {
                        return $this->modx->lexicon($this->objectType . '_err_ns');
                    }
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 45 mins 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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function process() {
                    /* Run the beforeSet method before setting the fields, and allow stoppage */
                    $canSave = $this->beforeSet();
                    if ($canSave !== true) {
                        return $this->failure($canSave);
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 35 mins 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 getAllErrors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getAllErrors($fieldErrorSeparator = ': ') {
                    $errormsgs = array();
                    if ($this->hasMessage()) {
                        $errormsgs[] = $this->getMessage();
                    }
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 35 mins 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 iterate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function iterate(array $data) {
                    $list = array();
                    $list = $this->beforeIteration($list);
                    $this->currentIndex = 0;
                    /** @var xPDOObject|modAccessibleObject $object */
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 35 mins 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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function run() {
                    if (!$this->checkPermissions()) {
                        $o = $this->failure($this->modx->lexicon('permission_denied_processor', array(
                            'action' => preg_replace('/[^\w\-_\/]+/i', '', $this->getProperty('action')),
                            'permission' => ($this->permission != '') ? $this->permission : '- unknown -'
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 35 mins 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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function process() {
                    /** @var SimpleXmlElement $xml */
                    $this->xml = @simplexml_load_string($this->xml);
                    if (empty($this->xml)) return $this->failure($this->modx->lexicon('import_err_xml'));
            
            
            Severity: Minor
            Found in core/model/modx/modprocessor.class.php - About 35 mins 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

            Avoid too many return statements within this method.
            Open

                    return parent::initialize();
            Severity: Major
            Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $this->modx->lexicon($this->objectType . '_err_df_ns');
              Severity: Major
              Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $this->modx->lexicon($this->objectType . '_err_dof_ns');
                Severity: Major
                Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $this->cleanup();
                  Severity: Major
                  Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return $this->cleanup();
                    Severity: Major
                    Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return parent::initialize();
                      Severity: Major
                      Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $this->failure($this->modx->lexicon('simplexml_err_nf'));
                        Severity: Major
                        Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return $this->modx->lexicon($this->objectType . '_err_dbf_ns');
                          Severity: Major
                          Found in core/model/modx/modprocessor.class.php - About 30 mins to fix

                            Function process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function process() {
                                    $canRemove = $this->beforeRemove();
                                    if ($canRemove !== true) {
                                        return $this->failure($canRemove);
                                    }
                            Severity: Minor
                            Found in core/model/modx/modprocessor.class.php - About 25 mins 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function initialize() {
                                    $file = $this->getProperty($this->fileProperty);
                                    if (empty($file) || !isset($file['tmp_name'])) return $this->modx->lexicon('import_err_upload');
                                    if ($file['error'] != 0) return $this->modx->lexicon('import_err_upload');
                                    if (!file_exists($file['tmp_name'])) return $this->modx->lexicon('import_err_upload');
                            Severity: Minor
                            Found in core/model/modx/modprocessor.class.php - About 25 mins 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

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

                                public function initialize() {
                                    $primaryKey = $this->getProperty($this->primaryKeyField,false);
                                    if (empty($primaryKey)) return $this->modx->lexicon($this->objectType.'_err_ns');
                                    $this->object = $this->modx->getObject($this->classKey,$primaryKey);
                                    if (empty($this->object)) return $this->modx->lexicon($this->objectType.'_err_nfs',array($this->primaryKeyField => $primaryKey));
                            Severity: Major
                            Found in core/model/modx/modprocessor.class.php and 2 other locations - About 3 hrs to fix
                            core/model/modx/modprocessor.class.php on lines 424..435
                            core/model/modx/modprocessor.class.php on lines 1143..1154

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

                            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

                                public function initialize() {
                                    $primaryKey = $this->getProperty($this->primaryKeyField,false);
                                    if (empty($primaryKey)) return $this->modx->lexicon($this->objectType.'_err_ns');
                                    $this->object = $this->modx->getObject($this->classKey,$primaryKey);
                                    if (empty($this->object)) return $this->modx->lexicon($this->objectType.'_err_nfs',array($this->primaryKeyField => $primaryKey));
                            Severity: Major
                            Found in core/model/modx/modprocessor.class.php and 2 other locations - About 3 hrs to fix
                            core/model/modx/modprocessor.class.php on lines 797..808
                            core/model/modx/modprocessor.class.php on lines 1143..1154

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

                            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

                                public function initialize() {
                                    $primaryKey = $this->getProperty($this->primaryKeyField,false);
                                    if (empty($primaryKey)) return $this->modx->lexicon($this->objectType.'_err_ns');
                                    $this->object = $this->modx->getObject($this->classKey,$primaryKey);
                                    if (empty($this->object)) return $this->modx->lexicon($this->objectType.'_err_nfs',array($this->primaryKeyField => $primaryKey));
                            Severity: Major
                            Found in core/model/modx/modprocessor.class.php and 2 other locations - About 3 hrs to fix
                            core/model/modx/modprocessor.class.php on lines 424..435
                            core/model/modx/modprocessor.class.php on lines 797..808

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

                            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

                                public function fireBeforeRemoveEvent() {
                                    $preventRemove = false;
                                    if (!empty($this->beforeRemoveEvent)) {
                                        $response = $this->modx->invokeEvent($this->beforeRemoveEvent,array(
                                            $this->primaryKeyField => $this->object->get($this->primaryKeyField),
                            Severity: Minor
                            Found in core/model/modx/modprocessor.class.php and 1 other location - About 45 mins to fix
                            core/model/modx/modprocessor.class.php on lines 1379..1391

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

                            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

                                public function fireBeforeRemoveEvent() {
                                    $preventRemove = false;
                                    if (!empty($this->beforeRemoveEvent)) {
                                        $response = $this->modx->invokeEvent($this->beforeRemoveEvent, array(
                                            $this->primaryKeyField => $this->object->get($this->primaryKeyField),
                            Severity: Minor
                            Found in core/model/modx/modprocessor.class.php and 1 other location - About 45 mins to fix
                            core/model/modx/modprocessor.class.php on lines 1214..1225

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

                            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

                            There are no issues that match your filters.

                            Category
                            Status