squirrly/squirrly-seo

View on GitHub

Showing 149 of 200 total issues

File SQ_Frontend.php has 882 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

class Model_SQ_Frontend {

    /** @var string */
Severity: Major
Found in models/SQ_Frontend.php - About 2 days to fix

    Function __construct has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
    Open

        function __construct($image, $newfile) {
            $ret = "";
    
            $ret.= $this->jpexs_inttoword(0); //PASSWORD
            $ret.=$this->jpexs_inttoword(1); //SOURCE
    Severity: Minor
    Found in models/SQ_Menu.php - About 1 day 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 generateSitemap has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
    Open

        public function generateSitemap() {
            global $wpdb, $wp_query, $wp_version;
            /* get the home url */
            $home = get_bloginfo('url');
            $homeID = 0;
    Severity: Minor
    Found in classes/SQ_Sitemap.php - About 1 day 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 grabKeywordsFromPost has a Cognitive Complexity of 76 (exceeds 5 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: Minor
    Found in models/SQ_Frontend.php - About 1 day 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_Menu.php has 516 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    class Model_SQ_Menu {
    
        /** @var array with the menu content
    Severity: Major
    Found in models/SQ_Menu.php - About 1 day to fix

      Method __construct has 176 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function __construct($image, $newfile) {
              $ret = "";
      
              $ret.= $this->jpexs_inttoword(0); //PASSWORD
              $ret.=$this->jpexs_inttoword(1); //SOURCE
      Severity: Major
      Found in models/SQ_Menu.php - About 7 hrs to fix

        Model_SQ_Frontend has 48 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Model_SQ_Frontend {
        
            /** @var string */
            private $title;
        
        Severity: Minor
        Found in models/SQ_Frontend.php - About 6 hrs to fix

          Function getActions has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getActions($cur_action) {
          
                  /* if config allready in cache */
                  if (!isset(self::$config)) {
                      $config_file = _SQ_CORE_DIR_ . 'config.xml';
          Severity: Minor
          Found in classes/SQ_Action.php - About 6 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 getCanonicalUrl has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

              function getCanonicalUrl() {
                  global $wp_query;
          
                  if (!isset($wp_query) || $wp_query->is_404 || $wp_query->is_search) {
                      return false;
          Severity: Minor
          Found in models/SQ_Frontend.php - About 6 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 checkImage has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

              function checkImage($post_id) {
                  @set_time_limit(90);
                  $local_file = false;
          
                  $content = stripslashes(SQ_Tools::getValue('post_content'));
          Severity: Minor
          Found in controllers/SQ_Post.php - About 6 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 generateSitemap has 144 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function generateSitemap() {
                  global $wpdb, $wp_query, $wp_version;
                  /* get the home url */
                  $home = get_bloginfo('url');
                  $homeID = 0;
          Severity: Major
          Found in classes/SQ_Sitemap.php - About 5 hrs to fix

            Function getBlocks has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getBlocks($for) {
                    /* if config allready in cache */
                    if (!isset(self::$config)) {
                        $config_file = _SQ_CORE_DIR_ . 'config.xml';
                        if (!file_exists($config_file))
            Severity: Minor
            Found in classes/SQ_ObjController.php - About 5 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 progressBar has 138 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    progressBar: new function() {
            
                        this.defaults = {
                            steps: 2, // steps taken to reach target
                            stepDuration: 2,
            Severity: Major
            Found in themes/default/js/jquery.progressbar.js - About 5 hrs to fix

              Function addFavicon has a Cognitive Complexity of 36 (exceeds 5 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: Minor
              Found in models/SQ_Menu.php - About 5 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_Tools.php has 386 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * Handles the parameters and url
               *
              Severity: Minor
              Found in classes/SQ_Tools.php - About 5 hrs to fix

                Function getCustomDescription has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function getCustomDescription() {
                        global $wp_query;
                        $sep = '|';
                        $description = '';
                
                Severity: Minor
                Found in models/SQ_Frontend.php - About 4 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 calcDensity has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function calcDensity($text, $title = '', $description = '') {
                        $keywords = array();
                        $text = $title . '. ' . $text;
                        $text = @preg_replace('/[^a-zA-Z0-9-.]/', ' ', $text);
                        $title = explode(" ", $title);
                Severity: Minor
                Found in models/SQ_Frontend.php - About 4 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 construct has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            this.construct = function(arg1, arg2) {
                                var argvalue = null;
                                var argconfig = null;
                
                                if (arg1 != null) {
                Severity: Major
                Found in themes/default/js/jquery.progressbar.js - About 4 hrs to fix

                  File SQ_Menu.php has 351 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <div id="sq_settings" >
                      <form id="sq_settings_form" name="settings" action="" method="post" enctype="multipart/form-data">
                  
                          <div id="sq_settings_title" ><?php _e('Squirrly settings', _PLUGIN_NAME_); ?> <input type="submit" name="sq_update" value="<?php _e('Save settings', _PLUGIN_NAME_) ?> &raquo;" /> <a href="post-new.php" id="sq_goto_newpost" <?php echo (($view->options['sq_api'] <> '') ? '' : 'style="display:none"') ?> /><?php _e('Optimize with Squirrly', _PLUGIN_NAME_) ?></a></div>
                          <div id="sq_settings_body">
                  Severity: Minor
                  Found in themes/default/SQ_Menu.php - About 4 hrs to fix

                    File SQ_PostsList.php has 342 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    class Model_SQ_PostsList {
                    
                        /** @var integer */
                    Severity: Minor
                    Found in models/SQ_PostsList.php - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language