squirrly/squirrly-seo

View on GitHub

Showing 149 of 200 total issues

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

    private function createBdTables() {
        global $wpdb;
        if ($wpdb->get_var("SHOW TABLES LIKE '" . $this->analytics_table . "'") != $this->analytics_table) {
            $sql = "CREATE TABLE `" . $this->analytics_table . "` (
                    `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
Severity: Minor
Found in classes/SQ_Traffic.php - About 1 hr to fix

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

        public function getOthersSERPZone($serp) {
            $str = '';
    
            if (!is_array($serp))
                return $str;
    Severity: Minor
    Found in models/SQ_PostsList.php - About 1 hr to fix

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

          private function checkWs() {
              if (!self::$options['sq_ws'])
                  return;
      
              //if debug is called
      Severity: Minor
      Found in classes/SQ_Tools.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 checkErrorSettings has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function checkErrorSettings($count_only = false) {
      
      
              if (function_exists('is_network_admin') && is_network_admin())
                  return;
      Severity: Minor
      Found in classes/SQ_Tools.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 getImageFromContent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getImageFromContent() {
              global $wp_query;
              $match = array();
              $post = $this->post;
      
      Severity: Minor
      Found in models/SQ_Frontend.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 addMeta has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addMeta($param = null) {
              if ($param)
                  $this->meta = $param;
      
      
      Severity: Minor
      Found in models/SQ_Menu.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 squirrlyRegister has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          function squirrlyRegister() {
              global $current_user;
              //set return to null object as default
              $return = (object) NULL;
              //api responce variable
      Severity: Minor
      Found in core/SQ_Blocklogin/SQ_Blocklogin.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 hookNotices has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          function hookNotices() {
              if (is_array(self::$errors))
                  foreach (self::$errors as $error) {
      
                      switch ($error['type']) {
      Severity: Minor
      Found in classes/SQ_Error.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 grabDescriptionFromPost has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          function grabDescriptionFromPost($id = null) {
              global $wp_query;
              $post = null;
              $description = '';
              $advdescription = '';
      Severity: Minor
      Found in models/SQ_Frontend.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 sq_submitSettings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function sq_submitSettings() {
          jQuery.getJSON(
                  sqQuery.ajaxurl,
                  {
                      action: 'sq_settings_update',
      Severity: Minor
      Found in themes/default/js/sq_menu.js - About 1 hr to fix

        Function arrowClick has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                arrowClick: function(post_id, _this, scroll) {
                    //Load the brief information
                    SQ.sq_eventsrank.loadBrief(post_id);
        
                    if (jQuery('#sq_post-' + post_id).is(":visible")) {
        Severity: Minor
        Found in themes/default/js/sq_rank.js - About 1 hr to fix

          Method squirrlyRegister has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function squirrlyRegister() {
                  global $current_user;
                  //set return to null object as default
                  $return = (object) NULL;
                  //api responce variable
          Severity: Minor
          Found in core/SQ_Blocklogin/SQ_Blocklogin.php - About 1 hr to fix

            Method hookHead has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function hookHead() {
                    global $sq_postID;
            
                    parent::hookHead();
                    $exists = false;
            Severity: Minor
            Found in core/SQ_Loading/SQ_Loading.php - About 1 hr to fix

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

                                  var t = setInterval(function() {
                                      var pixels = config.width / 100;            // Define how many pixels go into 1%
              
                                      if (config.running_value > config.value) {
                                          if (config.running_value - config.increment < config.value) {
              Severity: Minor
              Found in themes/default/js/jquery.progressbar.js - About 1 hr to fix

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

                    function action() {
                        $start = 0;
                        $nbr = 8;
                        $exclude = array();
                
                Severity: Minor
                Found in core/SQ_Blocksearch/SQ_Blocksearch.php - About 1 hr to fix

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

                      function squirrlyLogin() {
                          //set return to null object as default
                          $return = (object) NULL;
                          //api responce variable
                          $responce = '';
                  Severity: Minor
                  Found in core/SQ_Blocklogin/SQ_Blocklogin.php - About 1 hr to fix

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

                        public function getOtherKeywords($post_id) {
                            global $wpdb;
                            $other_keywords = array();
                            $sql = "SELECT count(kw.`keyword`) as searched, kw.`keyword`
                                           FROM `" . $this->keyword_table . "` kw
                    Severity: Minor
                    Found in classes/SQ_Ranking.php - About 1 hr to fix

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

                          public function getActions($cur_action) {
                      
                              /* if config allready in cache */
                              if (!isset(self::$config)) {
                                  $config_file = _SQ_CORE_DIR_ . 'config.xml';
                      Severity: Minor
                      Found in classes/SQ_Action.php - About 1 hr to fix

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

                            public function packStatus($progress) {
                                $str = '';
                                //Check show conditions
                                if (!$this->showPopup($progress))
                                    return;
                        Severity: Minor
                        Found in models/SQ_BlockStatus.php - About 1 hr to fix

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

                              private function getGraph($div) {
                                  $traffic = SQ_ObjController::getController('SQ_Traffic', false)->getHistory($this->post_id, $this->interval, 'ASC');
                                  $rows = array();
                                  $table = array();
                                  $table['cols'] = array(
                          Severity: Minor
                          Found in models/SQ_PostsList.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language