kai-jacobsen/kontentblocks

View on GitHub

Showing 4,293 of 4,293 total issues

Avoid too many return statements within this method.
Open

            return false;
Severity: Major
Found in core/Backend/Dynamic/GlobalModulesMenu.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $data;
    Severity: Major
    Found in core/Backend/Dynamic/GlobalModulesMenu.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return;
      Severity: Major
      Found in core/Fields/ModuleFieldSection.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return $this;
        Severity: Major
        Found in core/Fields/StandardFieldSection.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return true;
          Severity: Major
          Found in core/Fields/Definitions/ReturnObjects/FlexibleFieldsReturn.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return;
            Severity: Major
            Found in core/Fields/ModuleFieldSection.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $file;
              Severity: Major
              Found in core/Fields/Definitions/Image.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return;
                Severity: Major
                Found in core/Fields/ModuleFieldSection.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $this;
                  Severity: Major
                  Found in core/Fields/StandardFieldSection.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return;
                    Severity: Major
                    Found in core/Fields/ModuleFieldSection.php - About 30 mins to fix

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

                              if (is_null($this->postdata->request->getInt('blog_id', null))) {
                                  return false;
                              } else {
                                  $blogIdSubmit = $this->postdata->request->getInt('blog_id', null);
                                  $blogIdCurrent = get_current_blog_id();
                      Severity: Minor
                      Found in core/Backend/Environment/Save/SavePost.php and 1 other location - About 30 mins to fix
                      core/Backend/Environment/Save/SaveRevision.php on lines 126..134

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

                      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 (is_null($this->postdata->request->getInt('blog_id', null))) {
                                  return false;
                              } else {
                                  $blogIdSubmit = $this->postdata->request->getInt('blog_id', null);
                                  $blogIdCurrent = get_current_blog_id();
                      Severity: Minor
                      Found in core/Backend/Environment/Save/SaveRevision.php and 1 other location - About 30 mins to fix
                      core/Backend/Environment/Save/SavePost.php on lines 99..107

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

                      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

                              }).on('select', function (what) {
                                var attachment = this.get('library').get('selection').first();
                                that.replace(attachment);
                              }).open();
                      Severity: Minor
                      Found in js/src/fields/controls/image.js and 1 other location - About 30 mins to fix
                      js/src/frontend/Inline/EditableImageView.js on lines 124..127

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

                      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

                              }).on('select', function () {
                                var attachment = this.get('library').get('selection').first();
                                that.replace(attachment);
                              }).open();
                      Severity: Minor
                      Found in js/src/frontend/Inline/EditableImageView.js and 1 other location - About 30 mins to fix
                      js/src/fields/controls/image.js on lines 108..111

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

                      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

                      Missing class import via use statement (line '63', column '25').
                      Open

                              $stdClass = new \stdClass();

                      MissingImport

                      Since: 2.7.0

                      Importing all external classes in a file through use statements makes them clearly visible.

                      Example

                      function make() {
                          return new \stdClass();
                      }

                      Source http://phpmd.org/rules/cleancode.html#MissingImport

                      Remove error control operator '@' on line 67.
                      Open

                          public static function createAttachmentObject($cropped, $parentAttachmentId)
                          {
                              $parent = get_post($parentAttachmentId);
                              $parentUrl = $parent->guid;
                              $url = str_replace(basename($parentUrl), basename($cropped), $parentUrl);
                      Severity: Minor
                      Found in core/Ajax/Actions/CropImage.php by phpmd

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      The method addArea has a boolean flag argument $manual, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function addArea($args, $manual = true)
                      Severity: Minor
                      Found in core/Areas/AreaRegistry.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                      The method kb_render_area has a boolean flag argument $echo, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                      function kb_render_area( $area = null, $post_id = null, $additionalArgs = null, $moduleSettings = array(), $echo = true )
                      Severity: Minor
                      Found in includes/wp-api.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                      The method renderSingleArea has a boolean flag argument $echo, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                      function renderSingleArea($areaId, $post_id = null, $areaSettings = array(), $moduleSettings = array(), $echo = true)
                      Severity: Minor
                      Found in includes/kb-api.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                      The method __construct has a boolean flag argument $send, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function __construct($message = '', $data = array(), $send = true)
                      Severity: Minor
                      Found in core/Ajax/AbstractAjaxResponse.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                      Severity
                      Category
                      Status
                      Source
                      Language