kai-jacobsen/kontentblocks

View on GitHub

Showing 4,293 of 4,293 total issues

Function geocode has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    geocode: function(query, cb, context) {
      var params = {
        address: query
      };

Severity: Minor
Found in js/third-party/leaflet.js - About 1 hr to fix

    Method toJSON has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        final public function toJSON()
        {
            $toJSON = array(
                'envVars' => $this->context,
                'settings' => $this->properties->settings,
    Severity: Minor
    Found in core/Modules/Module.php - About 1 hr to fix

      Function reverse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          reverse: function(location, scale, cb, context) {
            var params = {
              latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng)
            };
            params = L.Util.extend(params, this.options.reverseQueryParams);
      Severity: Minor
      Found in js/third-party/leaflet.js - About 1 hr to fix

        Function _parseResults has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _parseResults: function(data, bboxname) {
              var results = [];
              L.geoJson(data, {
                pointToLayer: function(feature, latlng) {
                  return L.circleMarker(latlng);
        Severity: Minor
        Found in js/third-party/leaflet.js - About 1 hr to fix

          Function geocode has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                geocode: function(query, cb, context) {
                  var params = {
                    address: query
                  };
          
          
          Severity: Minor
          Found in js/third-party/leaflet-geocoder.js - About 1 hr to fix

            Function update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              update: function () {
                var that = this;
                var refresh = false;
                jQuery.ajax({
                  url: ajaxurl,

              Function reverse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    reverse: function(location, scale, cb, context) {
                      var params = {
                        latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng)
                      };
                      params = L.Util.extend(params, this.options.reverseQueryParams);
              Severity: Minor
              Found in js/third-party/leaflet-geocoder.js - About 1 hr to fix

                Method save has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function save($postId, \WP_Post $postObj)
                    {
                        // auth request
                        if (!$this->auth($postId)) {
                            return false;
                Severity: Minor
                Found in core/Backend/Dynamic/GlobalModulesMenu.php - About 1 hr to fix

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

                    getField: function (key, arrayKey) {
                      if (!_.isEmpty(arrayKey)) {
                        return this.attachedFields[arrayKey][key];
                      } else {
                        return this.attachedFields[key];
                  Severity: Major
                  Found in js/src/backend/Views/ModuleView.js and 1 other location - About 1 hr to fix
                  js/src/frontend/Views/ModuleView.js on lines 119..125

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

                  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

                  Method html has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function html()
                      {
                          $this->handleLoggedInUsers();
                          $format = '<%1$s id="%4$s" %3$s>%2$s</%1$s>';
                          $formatWithLink = '<%1$s id="%4$s" %3$s><a href="%5$s">%2$s</a></%1$s>';
                  Severity: Minor
                  Found in core/Fields/Definitions/ReturnObjects/EditableElement.php - About 1 hr to fix

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

                      getField: function (key, arrayKey) {
                        if (!_.isEmpty(arrayKey)) {
                          return this.attachedFields[arrayKey][key];
                        } else {
                          return this.attachedFields[key];
                    Severity: Major
                    Found in js/src/frontend/Views/ModuleView.js and 1 other location - About 1 hr to fix
                    js/src/backend/Views/ModuleView.js on lines 188..194

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

                    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

                      function createContextViews(context) {
                        KB.Views.Contexts.add(context.get('id'), new ContextView({
                          model: context,
                          el: '#context_' + context.get('id')
                        }))
                    Severity: Major
                    Found in js/src/backend/BackendController.js and 1 other location - About 1 hr to fix
                    js/src/fields/controls/subarea/SubareaController.js on lines 36..41

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

                    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

                              _.defer(function () {
                                KB.Views.Modules.add(moduleModel.get('mid'), new ModuleView({
                                  model: moduleModel,
                                  el: '#' + moduleModel.get('mid')
                                }));
                    Severity: Major
                    Found in js/src/fields/controls/subarea/SubareaController.js and 1 other location - About 1 hr to fix
                    js/src/backend/BackendController.js on lines 205..210

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

                    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

                        public function export(FieldExport $exporter)
                        {
                            $kpath = $this->createKPath();
                            $exporter->addField($kpath, array(
                                'key' => $this->getKey(),
                    Severity: Major
                    Found in core/Fields/Field.php and 1 other location - About 1 hr to fix
                    core/Fields/Definitions/Context.php on lines 90..103

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

                    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

                        public function export(FieldExport $exporter)
                        {
                            $kpath = $this->createKPath();
                            $exporter->addField($kpath, array(
                                'key' => $this->getKey(),
                    Severity: Major
                    Found in core/Fields/Definitions/Context.php and 1 other location - About 1 hr to fix
                    core/Fields/Field.php on lines 549..562

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

                    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

                    Avoid using undefined variables such as '::$settings' which will lead to PHP notices.
                    Open

                                return static::$settings[$key];
                    Severity: Minor
                    Found in core/Fields/Field.php by phpmd

                    UndefinedVariable

                    Since: 2.8.0

                    Detects when a variable is used that has not been defined before.

                    Example

                    class Foo
                    {
                        private function bar()
                        {
                            // $message is undefined
                            echo $message;
                        }
                    }

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

                    Avoid using undefined variables such as '::$aggregated_multidimensionals' which will lead to PHP notices.
                    Open

                                $root_value = self::$aggregated_multidimensionals[$this->type][$id_base]['root_value'];

                    UndefinedVariable

                    Since: 2.8.0

                    Detects when a variable is used that has not been defined before.

                    Example

                    class Foo
                    {
                        private function bar()
                        {
                            // $message is undefined
                            echo $message;
                        }
                    }

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

                    Avoid using undefined variables such as '::$settings' which will lead to PHP notices.
                    Open

                            if (isset(static::$settings[$key])) {
                    Severity: Minor
                    Found in core/Fields/Field.php by phpmd

                    UndefinedVariable

                    Since: 2.8.0

                    Detects when a variable is used that has not been defined before.

                    Example

                    class Foo
                    {
                        private function bar()
                        {
                            // $message is undefined
                            echo $message;
                        }
                    }

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

                    Avoid using undefined variables such as '::$settings' which will lead to PHP notices.
                    Open

                            $this->type = static::$settings['type'];
                    Severity: Minor
                    Found in core/Fields/Field.php by phpmd

                    UndefinedVariable

                    Since: 2.8.0

                    Detects when a variable is used that has not been defined before.

                    Example

                    class Foo
                    {
                        private function bar()
                        {
                            // $message is undefined
                            echo $message;
                        }
                    }

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

                    Function openFrame has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      openFrame: function () {
                        var that = this;
                        if (this.frame) {
                          this.frame.dispose();
                        }
                    Severity: Minor
                    Found in js/src/frontend/Inline/EditableImageView.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language