TeaThemeOptions/TeaThemeOptions

View on GitHub

Showing 177 of 177 total issues

Method prepareField has 40 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/Background.php - About 1 hr to fix

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

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

      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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    var $cont = $(document.createElement('div')).addClass('yt-container').css({
                        bottom: '0',
                        left: '0',
                        overflow: 'hidden',
                        position: 'fixed',
            Severity: Major
            Found in src/Resources/assets/js/youtube/youtube.js and 1 other location - About 1 hr to fix
            src/Resources/assets/js/youtube/youtube.js on lines 90..98

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 65.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    var $stripes = $(document.createElement('div')).addClass('yt-stripes').css({
                        bottom: '0',
                        left: '0',
                        overflow: 'hidden',
                        position: 'fixed',
            Severity: Major
            Found in src/Resources/assets/js/youtube/youtube.js and 1 other location - About 1 hr to fix
            src/Resources/assets/js/youtube/youtube.js on lines 80..88

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 65.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

              wind: {
                options: {
                  modifyVars: _.extend({}, {
                    primary: '#69d2e7',
                    second: '#e3f6fa',
            Severity: Major
            Found in tasks/options/less.js and 3 other locations - About 1 hr to fix
            tasks/options/less.js on lines 58..74
            tasks/options/less.js on lines 76..92
            tasks/options/less.js on lines 94..110

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 64.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

              vulcan: {
                options: {
                  modifyVars: _.extend({}, {
                    primary: '#d04d4d',
                    second: '#f7e5e5',
            Severity: Major
            Found in tasks/options/less.js and 3 other locations - About 1 hr to fix
            tasks/options/less.js on lines 58..74
            tasks/options/less.js on lines 76..92
            tasks/options/less.js on lines 112..128

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 64.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

              ocean: {
                options: {
                  modifyVars: _.extend({}, {
                    primary: '#4d9dd0',
                    second: '#e5edf7',
            Severity: Major
            Found in tasks/options/less.js and 3 other locations - About 1 hr to fix
            tasks/options/less.js on lines 58..74
            tasks/options/less.js on lines 94..110
            tasks/options/less.js on lines 112..128

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 64.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

              earth: {
                options: {
                  modifyVars: _.extend({}, {
                    primary: '#75cd45',
                    second: '#e5f7e5',
            Severity: Major
            Found in tasks/options/less.js and 3 other locations - About 1 hr to fix
            tasks/options/less.js on lines 76..92
            tasks/options/less.js on lines 94..110
            tasks/options/less.js on lines 112..128

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 64.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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
                          Severity
                          Category
                          Status
                          Source
                          Language