squirrly/squirrly-seo

View on GitHub

Showing 200 of 200 total issues

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

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

                      if (parseInt(jQuery('.sq_count').html()) >= 0) {
                          var notif = (parseInt(jQuery('.sq_count').html()) + 1);
                          if (notif > 0) {
                              jQuery('.sq_count').html(notif).show();
                          }
              Severity: Major
              Found in themes/default/js/sq_menu.js and 1 other location - About 2 hrs to fix
              themes/default/js/sq_menu.js on lines 149..154

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

              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

                      if (parseInt(jQuery('.sq_count').html()) >= 0) {
                          var notif = (parseInt(jQuery('.sq_count').html()) + 1);
                          if (notif > 0) {
                              jQuery('.sq_count').html(notif).show();
                          }
              Severity: Major
              Found in themes/default/js/sq_menu.js and 1 other location - About 2 hrs to fix
              themes/default/js/sq_menu.js on lines 125..130

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

              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

                  jQuery('#sq_settings').find('textarea[name=sq_fp_description]').bind('keyup', function() {
                      if (snippet_timeout) {
                          clearTimeout(snippet_timeout);
                      }
              
              
              Severity: Major
              Found in themes/default/js/sq_menu.js and 1 other location - About 2 hrs to fix
              themes/default/js/sq_menu.js on lines 73..84

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

              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

                  jQuery('#sq_settings').find('input[name=sq_fp_title]').bind('keyup', function() {
                      if (snippet_timeout) {
                          clearTimeout(snippet_timeout);
                      }
              
              
              Severity: Major
              Found in themes/default/js/sq_menu.js and 1 other location - About 2 hrs to fix
              themes/default/js/sq_menu.js on lines 88..99

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

              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

              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

                  Function getRanks has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          getRanks: function(posts) {
                              jQuery.getJSON(
                                      sqQuery.ajaxurl,
                                      {
                                          action: 'sq_posts_rank',
                  Severity: Major
                  Found in themes/default/js/sq_rank.js - About 2 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (is_home() || (isset($wp_query->query) && empty($wp_query->query)) || is_single() || is_preview() || is_page() || is_archive() || is_category() || is_author() || is_tag() || is_search()) {
                    
                    
                                /* Meta setting */
                                $this->title = $this->clearTitle($this->getCustomTitle());
                    Severity: Critical
                    Found in models/SQ_Frontend.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language