squirrly/squirrly-seo

View on GitHub

Showing 149 of 200 total issues

Avoid too many return statements within this method.
Open

                    return;
Severity: Major
Found in models/SQ_Menu.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return 0;
    Severity: Major
    Found in classes/SQ_Ranking.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $link;
      Severity: Major
      Found in models/SQ_Frontend.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return;
        Severity: Major
        Found in models/SQ_Menu.php - About 30 mins to fix

          Function searchPhrase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              function searchPhrase($text) {
                  $words = explode(".", strtolower($text));
                  //print_r($words);
                  $frequencies = array();
                  foreach ($words as $str) {
          Severity: Minor
          Found in models/SQ_Frontend.php - About 25 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 setAdminHooks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function setAdminHooks($instance) {
          
                  /* for each admin action check if is defined in class and call it */
                  foreach ($this->admin_hooks as $hook => $value) {
          
          Severity: Minor
          Found in classes/SQ_HookController.php - About 25 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 action has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              function action() {
                  parent::action();
                  switch (SQ_Tools::getValue('action')) {
                      //login action
                      case 'sq_settings_affiliate':
          Severity: Minor
          Found in core/SQ_BlockAffiliate/SQ_BlockAffiliate.php - About 25 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 searchPost has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function searchPost($q, $exclude = array(), $start = 0, $nbr = 8) {
                  global $wpdb;
                  $responce = array();
                  if (sizeof($exclude) > 1) {
                      $exclude = join(',', $exclude);
          Severity: Minor
          Found in models/SQ_Post.php - About 25 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 saveAdvMeta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function saveAdvMeta($post_id, $metas) {
                  global $wpdb;
          
                  if ((int) $post_id == 0 || !is_array($metas))
                      return;
          Severity: Minor
          Found in models/SQ_Post.php - About 25 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