TeaThemeOptions/TeaThemeOptions

View on GitHub

Showing 112 of 177 total issues

Method prepareField has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function prepareField($content, $details = array())
    {
        //Build details
        $post = isset($details['post']) ? $details['post'] : 0;
        $prefix = isset($details['prefix']) ? $details['prefix'] : '';
Severity: Minor
Found in src/Core/Field/Wordpress.php - About 1 hr to fix

    Method render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function render($template, $vars)
        {
            //Define Twig loaders
            $loader = new Twig_Loader_Filesystem(array(OLZ_TWIG_VIEWS));
    
    
    Severity: Minor
    Found in src/Core/Render/Render.php - About 1 hr to fix

      Method hookFieldsPermalink has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function hookFieldsPermalink()
          {
              if (empty($this->posttypes)) {
                  return false;
              }
      Severity: Minor
      Found in src/Core/PostType/PosttypeHook.php - About 1 hr to fix

        Function get_position has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            OlTooltip.prototype.get_position = function (){
                var _ol = this,
                    _off = _ol.$el.offset(),
                    coords = {};
        
        
        Severity: Minor
        Found in src/Resources/assets/js/tooltip/tooltip.js - About 1 hr to fix

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

              public function searchSuggest($type, $post, $tags)
              {
                  //Check page
                  if (!is_search()) {
                      return;
          Severity: Minor
          Found in src/Plugins/Search/SearchElastica.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 hookPermalinkMake has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              public function hookPermalinkMake($permalink, $post_id, $leavename)
              {
                  if (!$post_id) {
                      return '';
                  }
          Severity: Minor
          Found in src/Core/PostType/PosttypeHook.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 start_el has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
              {
                  if (empty($args['taxonomy'])) {
                      $taxonomy = 'category';
                  }
          Severity: Minor
          Found in src/Core/Walker/WalkerSingle.php - About 1 hr to fix

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

                public function prepareField($content, $details = array())
                {
                    //Build details
                    $post = isset($details['post']) ? $details['post'] : 0;
                    $prefix = isset($details['prefix']) ? $details['prefix'] : '';
            Severity: Minor
            Found in src/Core/Field/Text.php - About 1 hr to fix

              Function init has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  OlTooltip.prototype.init = function (){
                      var _ol = this;
              
                      //init globals
                      _ol.$win = $(window);
              Severity: Minor
              Found in src/Resources/assets/js/tooltip/tooltip.js - About 1 hr to fix

                Function map_refresh has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    OlMaps.prototype.map_refresh = function (){
                        var _ol = this,
                            _att = 'Built with ♥ by <a href="https://github.com/crewstyle/" target="_blank">Achraf Chouk</a> ~ &copy; <a href="http://osm.org/copyright" target="_blank">OpenStreetMap</a> contributors';
                
                        //get datum and coordinates
                Severity: Minor
                Found in src/Resources/assets/js/maps/maps.js - About 1 hr to fix

                  Method setTerms has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function setTerms($terms)
                      {
                          $this->terms = $terms;
                  
                          //Add WP Hooks
                  Severity: Minor
                  Found in src/Core/Term/TermHook.php - About 1 hr to fix

                    Method initializeDatas has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function initializeDatas()
                        {
                            //Admin panel
                            if (!OLZ_ISADMIN) {
                                return;
                    Severity: Minor
                    Found in src/Core/Action/Action.php - About 1 hr to fix

                      Method prepareField has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function prepareField($content, $details = array())
                          {
                              //Build details
                              $post = isset($details['post']) ? $details['post'] : 0;
                              $prefix = isset($details['prefix']) ? $details['prefix'] : '';
                      Severity: Minor
                      Found in src/Plugins/Search/SearchField.php - About 1 hr to fix

                        Method makeHooks has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function makeHooks()
                            {
                                //Admin panel
                                if (OLZ_ISADMIN) {
                                    return;
                        Severity: Minor
                        Found in src/Core/Hook/HookFrontend.php - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if ($hierarchical) {
                                      $labels['parent_item'] = isset($ctn['parent_item']) && !empty($ctn['parent_item']) 
                                          ? $ctn['parent_item'] 
                                          : OlympusZeus::translate('Parent item');
                                      $labels['parent_item_colon'] = isset($ctn['parent_item_colon']) && !empty($ctn['parent_item_colon']) 
                          Severity: Critical
                          Found in src/Core/Term/TermHook.php - About 1 hr to fix

                            Method hookFieldsSave has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function hookFieldsSave($term_id)
                                {
                                    //Admin panel
                                    if (!OLZ_ISADMIN) {
                                        return;
                            Severity: Minor
                            Found in src/Core/Term/TermHook.php - About 1 hr to fix

                              Method updateSettings has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function updateSettings($request, $files)
                                  {
                                      //Admin panel
                                      if (!OLZ_ISADMIN) {
                                          return;
                              Severity: Minor
                              Found in src/Core/Action/Action.php - About 1 hr to fix

                                Method getBackgroundDetails has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getBackgroundDetails()
                                    {
                                        return array(
                                            'position'  => array(
                                                '0 0'           => OlympusZeus::translate('Left top'),
                                Severity: Minor
                                Found in src/Core/Field/Background.php - About 1 hr to fix

                                  Method getFieldValue has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function getFieldValue($details, $default, $id = '', $multiple = false)
                                      {
                                          //Build details
                                          $post = isset($details['post']) ? $details['post'] : 0;
                                          $prefix = isset($details['prefix']) ? $details['prefix'] : '';
                                  Severity: Minor
                                  Found in src/Core/Field/Field.php - About 1 hr to fix

                                    Method prepareField has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function prepareField($content, $details = array())
                                        {
                                            //Build details
                                            $post = isset($details['post']) ? $details['post'] : 0;
                                            $prefix = isset($details['prefix']) ? $details['prefix'] : '';
                                    Severity: Minor
                                    Found in src/Core/Field/Link.php - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language