squirrly/squirrly-seo

View on GitHub
themes/default/js/sq_rank.js

Summary

Maintainability
C
1 day
Test Coverage

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

      Function loadBrief has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              loadBrief: function(post_id) {
                  if (jQuery('#sq_post-' + post_id).length == 0) {
      
                      jQuery('#post-' + post_id).after('<tr id="sq_post-' + post_id + '" style="display:none"><td colspan="' + (jQuery('#post-' + post_id + ' td').length + 1) + '" class="sq_post_rank_row"><div  class="sq_post_rank_title">' + __sq_article_rank + '</div><div class="sq_post_rank_content sq_loading"></div><div class="sq_post_arrow_details"></div><div class="sq_post_rank_close">x</div><div class="sq_post_rank_refresh">' + __sq_refresh + '</div></td></tr>');
                  } else {
      Severity: Major
      Found in themes/default/js/sq_rank.js - About 2 hrs 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

          There are no issues that match your filters.

          Category
          Status