squirrly/squirrly-seo

View on GitHub

Showing 149 of 200 total issues

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

    public function action() {

        parent::action();

        switch (SQ_Tools::getValue('action')) {
Severity: Major
Found in controllers/SQ_PostsList.php - About 3 hrs to fix

    Function getCustomTitle has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getCustomTitle() {
            global $wp_query;
            $count = 0;
            $title = '';
            $optitle = '';
    Severity: Minor
    Found in models/SQ_Frontend.php - About 3 hrs 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 action has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function action() {
            parent::action();
    
            switch (SQ_Tools::getValue('action')) {
                case 'sq_feedback':
    Severity: Minor
    Found in core/SQ_BlockSupport/SQ_BlockSupport.php - About 3 hrs 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

    SQ_Tools has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SQ_Tools extends SQ_FrontController {
    
        /** @var array Saved options in database */
        public static $options = array();
    
    Severity: Minor
    Found in classes/SQ_Tools.php - About 3 hrs to fix

      Method getCanonicalUrl has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function getCanonicalUrl() {
              global $wp_query;
      
              if (!isset($wp_query) || $wp_query->is_404 || $wp_query->is_search) {
                  return false;
      Severity: Major
      Found in models/SQ_Frontend.php - About 3 hrs to fix

        Method hookMenu has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function hookMenu() {
                $this->upgradeRedirect();
                $first_page = preg_replace('/\s/', '_', _SQ_NAME_);
        
                SQ_Tools::checkErrorSettings(true);
        Severity: Major
        Found in controllers/SQ_Menu.php - About 3 hrs to fix

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

              public function action() {
          
                  parent::action();
          
                  switch (SQ_Tools::getValue('action')) {
          Severity: Minor
          Found in controllers/SQ_PostsList.php - About 3 hrs 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 grabKeywordsFromPost has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function grabKeywordsFromPost($id = null) {
                  global $wp_query;
          
                  $this->max_keywrods = ($this->max_keywrods > 0 ? ($this->max_keywrods - 1) : 0);
                  if ($this->max_keywrods == 0)
          Severity: Major
          Found in models/SQ_Frontend.php - About 3 hrs to fix

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

                public function action() {
                    parent::action();
            
                    switch (SQ_Tools::getValue('action')) {
                        case 'sq_feedback':
            Severity: Major
            Found in core/SQ_BlockSupport/SQ_BlockSupport.php - About 3 hrs to fix

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

                  public function action() {
                      parent::action();
              
              
                      switch (SQ_Tools::getValue('action')) {
              Severity: Major
              Found in controllers/SQ_Menu.php - About 2 hrs to fix

                Function add_row has a Cognitive Complexity of 21 (exceeds 5 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 2 hrs 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 action has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function action() {
                        parent::action();
                
                
                        switch (SQ_Tools::getValue('action')) {
                Severity: Minor
                Found in controllers/SQ_Menu.php - About 2 hrs 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 addFavicon has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function addFavicon($file, $path = ABSPATH) {
                        $out = array();
                        $out['name'] = strtolower(basename($file['name']));
                        $out['tmp'] = _SQ_CACHE_DIR_ . strtolower(basename($file['name']));
                        $out['favicon'] = $path . "/" . 'favicon.ico';
                Severity: Major
                Found in models/SQ_Menu.php - About 2 hrs to fix

                  File sq_menu.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  jQuery(document).ready(function() {
                      var snippet_timeout;
                      jQuery("#sq_goto_dashboard").bind('click', function() {
                          location.href = "?page=sq_dashboard";
                      });
                  Severity: Minor
                  Found in themes/default/js/sq_menu.js - About 2 hrs to fix

                    Function sq_autoLogin has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function sq_autoLogin(){
                      if (!checkEmail(jQuery('#sq_email').val())){
                        jQuery('#sq_blocklogin').find('.sq_error').html(__invalid_email);
                        jQuery('#sq_register_email').show();
                        jQuery('#sq_register').html(__try_again);
                    Severity: Major
                    Found in themes/default/js/sq_blocklogin.js - About 2 hrs to fix

                      Function setHeader has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function setHeader() {
                              global $wp_query;
                              $ret = '';
                              $this->post = $wp_query->get_queried_object();
                              $this->meta['blogname'] = get_bloginfo('name');
                      Severity: Minor
                      Found in models/SQ_Frontend.php - About 2 hrs 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

                      File sq_rank.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      (function() {
                          var SQ = this;
                      
                          if (typeof this.sq_dashurl == 'undefined')
                              if (typeof sq_dashurl !== 'undefined')
                      Severity: Minor
                      Found in themes/default/js/sq_rank.js - About 2 hrs to fix

                        Function hookFrontcontent has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            function hookFrontcontent($content) {
                                if (!is_feed())
                                    return $content;
                        
                        
                        Severity: Minor
                        Found in controllers/SQ_Frontend.php - About 2 hrs 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 saveVisit has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function saveVisit() {
                                global $wpdb, $wp_query;
                                $post_id = 0;
                                $home = 0;
                                $sql = '';
                        Severity: Minor
                        Found in classes/SQ_Traffic.php - About 2 hrs 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 getCustomDescription has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getCustomDescription() {
                                global $wp_query;
                                $sep = '|';
                                $description = '';
                        
                        Severity: Major
                        Found in models/SQ_Frontend.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language