squirrly/squirrly-seo

View on GitHub

Showing 149 of 200 total issues

Function addSubmenu has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function addSubmenu($param = null) {
        if ($param)
            $this->menu = $param;

        if (is_array($this->menu)) {
Severity: Minor
Found in models/SQ_Menu.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 checkFavebookInsightsCode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkFavebookInsightsCode($code) {
        if ($code <> '') {
            if (strpos($code, 'content') !== false) {
                preg_match('/content\\s*=\\s*[\'\"]([^\'\"]+)[\'\"]/i', $code, $result);
                if (isset($result[1]) && !empty($result[1]))
Severity: Minor
Found in models/SQ_Menu.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 checkBingWTCode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkBingWTCode($code) {
        if ($code <> '') {
            if (strpos($code, 'content') !== false) {
                preg_match('/content\\s*=\\s*[\'\"]([^\'\"]+)[\'\"]/i', $code, $result);
                if (isset($result[1]) && !empty($result[1]))
Severity: Minor
Found in models/SQ_Menu.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 getBrowserInfo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getBrowserInfo() {
        $u_agent = $_SERVER['HTTP_USER_AGENT'];
        $bname = 'Unknown';
        $platform = 'Unknown';
        $version = "";
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 addMenu has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function addMenu($param = null) {
        if ($param)
            $this->menu = $param;

        if (is_array($this->menu)) {
Severity: Minor
Found in models/SQ_Menu.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 sq_getSnippet has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function sq_getSnippet(url, show_url) {
    if (typeof url == 'undefined')
        url = '';
    if (typeof sq_blogurl != 'undefined')
        url = sq_blogurl;
Severity: Minor
Found in themes/default/js/sq_menu.js - About 1 hr to fix

    Method getOtherPluginsMeta has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getOtherPluginsMeta($post_id, $meta = 'title') {
            global $wpdb;
            $field = '';
            $cond = '';
    
    Severity: Minor
    Found in models/SQ_Frontend.php - About 1 hr to fix

      Function dump has a Cognitive Complexity of 13 (exceeds 5 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

      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 sq_remote_get has a Cognitive Complexity of 13 (exceeds 5 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

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

          public function getAdvancedMeta($post_id, $meta = 'title') {
              global $wpdb;
              $field = '';
              $cond = '';
      
      Severity: Minor
      Found in models/SQ_Frontend.php - About 1 hr to fix

        Method getOptions has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getOptions() {
                $default = array(
                    'sq_beginner_user' => 1,
                    'sq_api' => '',
                    'sq_use' => 0,
        Severity: Minor
        Found in classes/SQ_Tools.php - About 1 hr to fix

          Method setHeader has 36 lines of code (exceeds 25 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 1 hr to fix

            Function apiCall has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function apiCall($module, $args = array(), $timeout = 60) {
                    $parameters = "";
            
                    if (SQ_Tools::$options['sq_api'] == '' && $module <> 'sq/login' && $module <> 'sq/register')
                        return false;
            Severity: Minor
            Found in classes/SQ_Action.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 getCustomKeyword has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                private function getCustomKeyword() {
                    global $wp_query;
                    $keywords = '';
            
                    if ($this->checkPostsPage() && SQ_Tools::$options['sq_auto_description'] == 1) {
            Severity: Minor
            Found in models/SQ_Frontend.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 loadMedia has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function loadMedia($uri = '', $media = 'all', $params = null) {
                    $css_uri = '';
                    $js_uri = '';
            
                    if (isset(self::$cache[$uri]))
            Severity: Minor
            Found in classes/SQ_DisplayController.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 packBrief has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function packBrief($response) {
                    if (!isset($response->seo))
                        return;
            
                    if (isset($response->seo) && ($response->seo->optimized == '0%')) {
            Severity: Minor
            Found in models/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 squirrlyLogin has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                function squirrlyLogin() {
                    //set return to null object as default
                    $return = (object) NULL;
                    //api responce variable
                    $responce = '';
            Severity: Minor
            Found in core/SQ_Blocklogin/SQ_Blocklogin.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 saveSitemap has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                private function saveSitemap($data) {
                    if (function_exists('gzopen') && function_exists('gzwrite') && function_exists('gzclose')) {
                        if (function_exists('file_exists') && file_exists($this->file . '.gz'))
                            @unlink($this->file . '.gz');
            
            Severity: Minor
            Found in classes/SQ_Sitemap.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 packBrief has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function packBrief($response) {
                    if (!isset($response->seo))
                        return;
            
                    if (isset($response->seo) && ($response->seo->optimized == '0%')) {
            Severity: Minor
            Found in models/SQ_PostsList.php - About 1 hr to fix

              Method getTrafficZone has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getTrafficZone() {
              
                      $traffic = $this->packTraffic($this->interval);
              
                      $str = '';
              Severity: Minor
              Found in models/SQ_PostsList.php - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language