kai-jacobsen/kontentblocks

View on GitHub

Showing 4,293 of 4,293 total issues

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

  openModal: function () {
    var that = this;

    // opens dialog if not already declared
    if (this._frame) {
Severity: Minor
Found in js/src/fields/controls/gallery2/Gallery2Controller.js - About 1 hr to fix

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

      openModal: function () {
        var that = this;
    
        // opens dialog if not already declared
        if (this._frame) {
    Severity: Minor
    Found in js/src/fields/controls/gallery-ext/GalleryExtController.js - About 1 hr to fix

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

        initialize: function (options) {
          var that = this;
          // CategoryView
          this.controller = options.controller;
          // ModuleListController
      Severity: Minor
      Found in js/src/frontend/Views/Sidebar/AreaDetails/ModuleDragItem.js - About 1 hr to fix

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

            protected static function action(Request $request)
            {
        
                $data = $request->request->filter('data', array(), FILTER_DEFAULT);
                // bail if essentials are missing
        Severity: Minor
        Found in core/Ajax/Actions/SortModules.php - About 1 hr to fix

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

              public static function getDefaultContextLayout()
              {
                  $defaults = array(
                      'top' => array(
                          'id' => 'top',
          Severity: Minor
          Found in core/Backend/EditScreens/ScreenManager.php - About 1 hr to fix

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

                public function setupMenu()
                {
                    if (!$this->menu) {
                        return false;
                    }
            Severity: Minor
            Found in core/Panels/OptionPanel.php - About 1 hr to fix

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

                  public function setupDiff()
                  {
                      $trans = get_transient('kb_dynamic_areas');
              
                      if (!$trans) {
              Severity: Minor
              Found in core/Areas/AreaDynamicManager.php - About 1 hr to fix

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

                    public static function remoteConcatGet($postId = null, $blocking = false, $host = null, $args = array())
                    {
                
                        if (apply_filters('kb.remote.concat.get.disable', false)) {
                            return null;
                Severity: Minor
                Found in core/Utils/Utilities.php - About 1 hr to fix

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

                      public function saveModules($modules)
                      {
                  
                          /** @var \Kontentblocks\Modules\Module $module */
                          foreach ($modules as $module) {
                  Severity: Minor
                  Found in core/Backend/Environment/Save/SaveRevision.php - About 1 hr to fix

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

                          _toggle: function() {
                            if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {
                              this._collapse();
                            } else {
                              this._expand();
                    Severity: Major
                    Found in js/third-party/leaflet-geocoder.js and 1 other location - About 1 hr to fix
                    js/third-party/leaflet.js on lines 1604..1610

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

                    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

                        _toggle: function() {
                          if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {
                            this._collapse();
                          } else {
                            this._expand();
                    Severity: Major
                    Found in js/third-party/leaflet.js and 1 other location - About 1 hr to fix
                    js/third-party/leaflet-geocoder.js on lines 395..401

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

                    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

                        Ajax.send({
                          action: 'syncAreaSettings',
                          _ajax_nonce: Config.getNonce('update'),
                          areaId: this.model.get('id'),
                          settings: settings
                    js/src/backend/Views/AreaControls/controls/StatusControl.js on lines 29..34
                    js/src/backend/Views/ContextBrowserAreaView.js on lines 29..34

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

                    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

                        Ajax.send({
                          action: 'getGlobalAreaHTML',
                          _ajax_nonce: Config.getNonce('update'),
                          areaId: this.model.get('id'),
                          settings: settings
                    Severity: Major
                    Found in js/src/backend/Views/ContextBrowserAreaView.js and 2 other locations - About 1 hr to fix
                    js/src/backend/Views/AreaControls/controls/DetachControl.js on lines 22..27
                    js/src/backend/Views/AreaControls/controls/StatusControl.js on lines 29..34

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

                    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

                        Ajax.send({
                          action: 'syncAreaSettings',
                          _ajax_nonce: Config.getNonce('update'),
                          areaId: this.model.get('id'),
                          settings: settings
                    js/src/backend/Views/AreaControls/controls/DetachControl.js on lines 22..27
                    js/src/backend/Views/ContextBrowserAreaView.js on lines 29..34

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

                    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

                        private function setupPanelsForUser()
                        {
                            $filtered = $this->filterPanelsForUser();
                            foreach ($filtered as $id => $panel) {
                                $panel['uid'] = hash('crc32', serialize($panel));
                    Severity: Major
                    Found in core/Panels/UserPanelRepository.php and 1 other location - About 1 hr to fix
                    core/Panels/TermPanelRepository.php on lines 25..35

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

                    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

                        private function setupPanelsForTerm()
                        {
                            $filtered = $this->filterPanelsForPost( );
                            foreach ($filtered as $id => $panel) {
                                $panel['uid'] = hash( 'crc32', serialize( $panel ) );
                    Severity: Major
                    Found in core/Panels/TermPanelRepository.php and 1 other location - About 1 hr to fix
                    core/Panels/UserPanelRepository.php on lines 26..36

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

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

                        _decodeFeatures: function(data) {
                          var results = [],
                            i,
                            f,
                            c,
                    Severity: Minor
                    Found in js/third-party/leaflet.js - About 1 hr to fix

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

                            geocode: function(query, cb, context) {
                              getJSON(
                                this.options.serviceUrl + 'search',
                                L.extend(
                                  {
                      Severity: Minor
                      Found in js/third-party/leaflet-geocoder.js - About 1 hr to fix

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

                            private function setupUtilities()
                            {
                        
                        
                                $this->services['utility.logger'] = function ($container) {
                        Severity: Minor
                        Found in kontentblocks.php - About 1 hr to fix

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

                                reverse: function(location, scale, cb, context) {
                                  getJSON(
                                    this.options.serviceUrl + 'reverse',
                                    L.extend(
                                      {
                          Severity: Minor
                          Found in js/third-party/leaflet-geocoder.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language