kai-jacobsen/kontentblocks

View on GitHub

Showing 398 of 4,293 total issues

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

    reverse: function(location, scale, cb, context) {
      getJSON(
        this.options.serviceUrl +
        encodeURIComponent(location.lng) +
        ',' +
Severity: Minor
Found in js/third-party/leaflet.js - About 1 hr to fix

    Method upscale has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                public function upscale($default, $orig_w, $orig_h, $dest_w, $dest_h, $crop)
                {
                    if (!$crop) {
                        return null;
                    } // Let the wordpress default function handle this.
    Severity: Minor
    Found in core/Utils/ImageResize.php - About 1 hr to fix

      Function calculateImageSelectOptions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          calculateImageSelectOptions: function (attachment, controller) {
            var xInit = parseInt(controller.frame.options.cropOptions.maxWidth, 10),
              yInit = parseInt(controller.frame.options.cropOptions.maxHeight, 10),
              ratio, xImg, yImg, realHeight, realWidth,
              imgSelectOptions;
      Severity: Minor
      Found in js/src/wpMediaExt/KB.media.Crop.js - About 1 hr to fix

        Function setupSortables has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          setupSortables: function () {
            var that = this;
            this.$el.sortable(
              {
                handle: ".kb-module-control--move",
        Severity: Minor
        Found in js/src/frontend/Views/AreaView.js - About 1 hr to fix

          Method saveModules has 33 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/SavePost.php - About 1 hr to fix

            Method auth has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function auth()
                {
                    $all = $this->postdata->request->all();
                    // verify if this is an auto save routine.
                    // If it is our form has not been submitted, so we dont want to do anything
            Severity: Minor
            Found in core/Backend/Environment/Save/SavePost.php - About 1 hr to fix

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

                  protected static function action(Request $request)
                  {
                      global $post;
              
                      $moduleArgs = Utilities::validateBoolRecursive($request->get('module'));
              Severity: Minor
              Found in core/Ajax/Actions/UpdateModuleData.php - About 1 hr to fix

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

                    protected static function action(Request $request)
                    {
                        $data = wp_unslash($request->request->get('data')); // remove slashes from ajax
                        $postEnvironment = Utilities::getPostEnvironment($data['post_ID']);
                
                
                Severity: Minor
                Found in core/Ajax/Actions/Autosave.php - About 1 hr to fix

                  Method registerPostType has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function registerPostType()
                      {
                  
                  
                          $labels = array(
                  Severity: Minor
                  Found in core/Backend/Dynamic/DynamicAreas.php - About 1 hr to fix

                    Method getFrontendValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getFrontendValue($salt = null)
                        {
                    
                            if (!is_null($this->userValue)) {
                                return $this->userValue;
                    Severity: Minor
                    Found in core/Fields/Field.php - About 1 hr to fix

                      Function reposition has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        reposition: function () {
                          var elpostop, elposleft, mSettings, submodule, pos, height;
                          elpostop = 0;
                          elposleft = 0;
                          mSettings = this.model.get('settings');
                      Severity: Minor
                      Found in js/src/frontend/Views/ModuleControls/ModuleControls.js - About 1 hr to fix

                        Function _createAlt has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              _createAlt: function(result, index) {
                                var li = L.DomUtil.create('li', ''),
                                  a = L.DomUtil.create('a', '', li),
                                  icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,
                                  text = result.html ? undefined : document.createTextNode(result.name),
                        Severity: Minor
                        Found in js/third-party/leaflet-geocoder.js - About 1 hr to fix

                          Function _createAlt has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _createAlt: function(result, index) {
                                var li = L.DomUtil.create('li', ''),
                                  a = L.DomUtil.create('a', '', li),
                                  icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,
                                  text = result.html ? undefined : document.createTextNode(result.name),
                          Severity: Minor
                          Found in js/third-party/leaflet.js - About 1 hr to fix

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

                                public function getTemplatesforContext(ModuleContext $context)
                                {
                                    $collection = array();
                                    $collection += $this->getSingles($this->views);
                                    $areaContext = $context->areaContext;
                            Severity: Minor
                            Found in core/Modules/ModuleViewFilesystem.php - About 1 hr to fix

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

                                    geocode: function(query, cb, context) {
                                      var params = {
                                        SingleLine: query,
                                        outFields: 'Addr_Type',
                                        forStorage: false,
                              Severity: Minor
                              Found in js/third-party/leaflet-geocoder.js - About 1 hr to fix

                                Function initDraggable has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  initDraggable: function () {
                                    var $source, $target, $sourcecontainer, $targetcontainer;
                                    var that = this;
                                    this.$('.kbml-slot-ref').draggable({
                                      revert: 'invalid',
                                Severity: Minor
                                Found in js/src/frontend/Views/LayoutAreaView.js - About 1 hr to fix

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

                                      public static function action(Request $request, $send = true)
                                      {
                                          global $post;
                                  
                                          $postdata = self::setupPostData($request);
                                  Severity: Minor
                                  Found in core/Ajax/Actions/Frontend/UpdateModule.php - About 1 hr to fix

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

                                        protected static function action(Request $request)
                                        {
                                            $module = wp_unslash($request->request->get('module'));
                                            $view = wp_unslash($request->request->get('view', ''));
                                            $environment = Utilities::getPostEnvironment($module['postId']);
                                    Severity: Minor
                                    Found in core/Ajax/Actions/DeleteModuleViewTemplate.php - About 1 hr to fix

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

                                          public function setupViews(Module $module)
                                          {
                                      
                                              if ($this->isChildTheme) {
                                                  $childPath = trailingslashit(
                                      Severity: Minor
                                      Found in core/Modules/ModuleViewFilesystem.php - About 1 hr to fix

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

                                            private function auth()
                                            {
                                        
                                                // if a revision gets restored, a new revision is created but everything from the normal edit screen is missing
                                                if ($this->isRevisionScreen === true) {
                                        Severity: Minor
                                        Found in core/Backend/Environment/Save/SaveRevision.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language