TeaThemeOptions/TeaThemeOptions

View on GitHub

Showing 112 of 177 total issues

File SearchElastica.php has 601 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace crewstyle\OlympusZeus\Plugins\Search;

use Elastica\Client;
Severity: Major
Found in src/Plugins/Search/SearchElastica.php - About 1 day to fix

    Method wp_enqueue_media_olz has 231 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static function wp_enqueue_media_olz($args = array())
        {
            //Admin panel
            if (!OLZ_ISADMIN) {
                return;
    Severity: Major
    Found in src/Core/Hook/HookBackend.php - About 1 day to fix

      Method getSocialNetworks has 212 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getSocialNetworks()
          {
              return array(
                  'twitter'       => array(
                      'url'           => OlympusZeus::translate('http://www.twitter.com/'),
      Severity: Major
      Found in src/Core/Field/Social.php - About 1 day to fix

        File HookBackend.php has 440 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace crewstyle\OlympusZeus\Core\Hook;
        
        use crewstyle\OlympusZeus\OlympusZeus;
        Severity: Minor
        Found in src/Core/Hook/HookBackend.php - About 6 hrs to fix

          Method analysis has 132 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function analysis($index, $posttypes, $terms)
              {
                  //Check integrity
                  if (empty($index)) {
                      return null;
          Severity: Major
          Found in src/Plugins/Search/SearchElastica.php - About 5 hrs to fix

            File PosttypeHook.php has 344 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace crewstyle\OlympusZeus\Core\Posttype;
            
            use crewstyle\OlympusZeus\OlympusZeus;
            Severity: Minor
            Found in src/Core/PostType/PosttypeHook.php - About 4 hrs to fix

              Function wp_enqueue_media_olz has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  static function wp_enqueue_media_olz($args = array())
                  {
                      //Admin panel
                      if (!OLZ_ISADMIN) {
                          return;
              Severity: Minor
              Found in src/Core/Hook/HookBackend.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 getFontGoogle has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getFontGoogle()
                  {
                      return array(
                          'sans_serif'    => array(
                              'name'  => 'sansserif',
              Severity: Major
              Found in src/Core/Field/Font.php - About 3 hrs to fix

                File Social.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace crewstyle\OlympusZeus\Core\Field;
                
                use crewstyle\OlympusZeus\OlympusZeus;
                Severity: Minor
                Found in src/Core/Field/Social.php - About 3 hrs to fix

                  Function indexContents has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function indexContents($idxctn = true)
                      {
                          //Check page
                          if (!OLZ_ISADMIN) {
                              return 0;
                  Severity: Minor
                  Found in src/Plugins/Search/SearchElastica.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

                  Function hookCleanBodyClass has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function hookCleanBodyClass($classes, $class)
                      {
                          //Remove unecessary CSS classes generated by WORDPRESS on authors pages
                          if (isset($classes['author'])) {
                              //Get author
                  Severity: Minor
                  Found in src/Core/Hook/HookFrontend.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 searchContents has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function searchContents()
                      {
                          //Return array
                          $return = array(
                              'query' => array(
                  Severity: Major
                  Found in src/Plugins/Search/SearchElastica.php - About 2 hrs to fix

                    Method tplVars has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function tplVars()
                        {
                            //Admin panel
                            if (!OLZ_ISADMIN) {
                                return;
                    Severity: Major
                    Found in src/Core/Menu/MenuTemplate.php - About 2 hrs to fix

                      Method hookSanitizeFilename has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function hookSanitizeFilename($filename)
                          {
                              //Invalid characters
                              $invalid = array(
                                  'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä€'=>'A', 'Ä‚'=>'A', 'Ȧ'=>'A', 'Ä'=>'A', 'Ả'=>'A', 'Ã…'=>'A', 'Ǎ'=>'A', 'È€'=>'A', 'È‚'=>'A', 'Ä„'=>'A', 'Ạ'=>'A', 'Ḁ'=>'A', 'Ầ'=>'A', 'Ấ'=>'A', 'Ẫ'=>'A', 'Ẩ'=>'A', 'Ằ'=>'A', 'Ắ'=>'A', 'Ẵ'=>'A', 'Ẳ'=>'A', 'Ç '=>'A', 'Çž'=>'A', 'Ǻ'=>'A', 'Ậ'=>'A', 'Ặ'=>'A',
                      Severity: Major
                      Found in src/Core/Hook/HookBackend.php - About 2 hrs to fix

                        Function analysis has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function analysis($index, $posttypes, $terms)
                            {
                                //Check integrity
                                if (empty($index)) {
                                    return null;
                        Severity: Minor
                        Found in src/Plugins/Search/SearchElastica.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 indexContents has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function indexContents($idxctn = true)
                            {
                                //Check page
                                if (!OLZ_ISADMIN) {
                                    return 0;
                        Severity: Major
                        Found in src/Plugins/Search/SearchElastica.php - About 2 hrs to fix

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

                              OlYoutube.prototype.youtube = function (){
                                  var _ol = this;
                          
                                  //build wrapper
                                  var $wrap = $(document.createElement('div')).css({
                          Severity: Major
                          Found in src/Resources/assets/js/youtube/youtube.js - About 2 hrs to fix

                            Method getModes has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getModes()
                                {
                                    return array(
                                        array(
                                            'title' => OlympusZeus::translate('CSS'),
                            Severity: Major
                            Found in src/Core/Field/Code.php - About 2 hrs to fix

                              Method hookPermalinkMake has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function hookPermalinkMake($permalink, $post_id, $leavename)
                                  {
                                      if (!$post_id) {
                                          return '';
                                      }
                              Severity: Major
                              Found in src/Core/PostType/PosttypeHook.php - About 2 hrs to fix

                                Function hookFieldsDisplay has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function hookFieldsDisplay()
                                    {
                                        //Defintions
                                        $slug = isset($_GET['post_type']) ? $_GET['post_type'] : '';
                                        $contents = array();
                                Severity: Minor
                                Found in src/Core/PostType/PosttypeHook.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

                                Severity
                                Category
                                Status
                                Source
                                Language