squirrly/squirrly-seo

View on GitHub

Showing 149 of 200 total issues

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

        private function getReferralKeyword() {
            if (!function_exists('parse_url') || !function_exists('preg_match'))
                return '';
    
            $keywords = '';
    Severity: Minor
    Found in classes/SQ_Traffic.php - About 1 hr to fix

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

          public static function dump() {
              $output = '';
              $callee = array('file' => '', 'line' => '');
              if (function_exists('func_get_args')) {
                  $arguments = func_get_args();
      Severity: Minor
      Found in classes/SQ_Tools.php - About 1 hr to fix

        Function hookInit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            function hookInit() {
                $browser = SQ_Tools::getBrowserInfo();
        
                if ($browser['name'] == 'IE' && (int) $browser['version'] < 9 && (int) $browser['version'] > 0)
                    return;
        Severity: Minor
        Found in controllers/SQ_PostsList.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 checkDebug has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function checkDebug() {
                //if debug is called
                if (self::getIsset('sq_debug')) {
        
        
        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 getGoogleRank has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            function getGoogleRank($post_id = 0, $keyword = "", $country = "com", $language = "en") {
                global $wpdb;
                $this->keyword = $keyword;
        
                $keyword = str_replace(" ", "+", urlencode(strtolower($keyword)));
        Severity: Minor
        Found in classes/SQ_Ranking.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 processRanking has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function processRanking(&$return, $post_id) {
                if (isset($return->seo) && is_object($return->seo)) {
                    $return->global_rank = $this->findTodayRank($post_id, 'global_rank');
                    $saved_keyword = $this->findTodayRank($post_id, 'keyword');
        
        Severity: Minor
        Found in classes/SQ_Ranking.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

        Method getRank has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRank($post_id = "") {
                global $wpdb;
        
                //Check if ranks is saved in database
                $sql = "SELECT analytics.`id`,analytics.`indexed`,analytics.`global_rank`,analytics.`local_rank`, analytics.`keyword`,analytics.`other_keywords`,analytics.`date`
        Severity: Minor
        Found in classes/SQ_Ranking.php - About 1 hr to fix

          Method sq_remote_get has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function sq_remote_get($url, $param = array()) {
                  $cookies = '';
                  $post_preview = false;
                  $cookies = array();
                  $cookie_string = '';
          Severity: Minor
          Found in classes/SQ_Tools.php - About 1 hr to fix

            Method getGoogleExtension has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function getGoogleExtension($language) {
                    switch ($language) {
                        case 'en':
                            $country = '';
                            break;
            Severity: Minor
            Found in classes/SQ_Ranking.php - About 1 hr to fix

              Method resizeImage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function resizeImage($maxwidth, $maxheight, $preserveAspect = true) {
                      $width = @imagesx($this->imgH);
                      $height = @imagesy($this->imgH);
              
                      if ($width > $maxwidth && $height > $maxheight) {
              Severity: Minor
              Found in models/SQ_Menu.php - About 1 hr to fix

                Method getAverage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function getAverage($interval = null, $post_id = 0) {
                        global $wpdb;
                
                        $average = array('count' => 0, 'unique' => 0, 'old' => 0);
                        $days = 0;
                Severity: Minor
                Found in classes/SQ_Traffic.php - About 1 hr to fix

                  Method getGoogleRank has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function getGoogleRank($post_id = 0, $keyword = "", $country = "com", $language = "en") {
                          global $wpdb;
                          $this->keyword = $keyword;
                  
                          $keyword = str_replace(" ", "+", urlencode(strtolower($keyword)));
                  Severity: Minor
                  Found in classes/SQ_Ranking.php - About 1 hr to fix

                    Method add_row has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function add_row($column, $post_id) {
                            $title = '';
                            $description = '';
                            $frontend = null;
                            $cached = false;
                    Severity: Minor
                    Found in controllers/SQ_PostsList.php - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (get_query_var('m')) {
                                  $m = @preg_replace('/[^0-9]/', '', get_query_var('m'));
                                  switch (strlen($m)) {
                                      case 4:
                                          $link = get_year_link($m);
                      Severity: Major
                      Found in models/SQ_Frontend.php - About 1 hr to fix

                        Function action has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            function action() {
                                $start = 0;
                                $nbr = 8;
                                $exclude = array();
                        
                        Severity: Minor
                        Found in core/SQ_Blocksearch/SQ_Blocksearch.php - About 55 mins 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 hookSavePost has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            function hookSavePost($post_id) {
                                $file_name = false;
                        
                        
                                // unhook this function so it doesn't loop infinitely
                        Severity: Minor
                        Found in controllers/SQ_Post.php - About 55 mins 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 getUniqueKeywords has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            function getUniqueKeywords($keywords) {
                                $all = array();
                                if (is_array($keywords))
                                    foreach ($keywords as $word) {
                                        if (function_exists('mb_strtolower'))
                        Severity: Minor
                        Found in models/SQ_Frontend.php - About 55 mins 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 grabTitleFromPost has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function grabTitleFromPost($id = null) {
                                global $wp_query;
                                $post = null;
                                $title = '';
                                $advtitle = '';
                        Severity: Minor
                        Found in models/SQ_Frontend.php - About 55 mins 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 getPublisher has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function getPublisher() {
                                $author = SQ_Tools::$options['sq_google_plus'];
                                if ($author == '')
                                    $author = $this->getAuthorLinkFromBlog();
                                elseif (!$author)
                        Severity: Minor
                        Found in models/SQ_Frontend.php - About 45 mins 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

                        Severity
                        Category
                        Status
                        Source
                        Language