TeaThemeOptions/TeaThemeOptions

View on GitHub

Showing 177 of 177 total issues

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

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

            $.each(_ol.$el.find(_ol.options.items), function (){
                _ol.$modal.find('a[data-nk="' + $(this).attr('data-nk') + '"]').addClass(_ol.options.active);
            });
    Severity: Major
    Found in src/Resources/assets/js/social/social.js and 1 other location - About 2 hrs to fix
    src/Resources/assets/js/social/social.js on lines 72..74

    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 92.

    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

            $.each(_ol.$el.find(_ol.options.items), function (){
                _ol.$modal.find('a[data-nk="' + $(this).attr('data-nk') + '"]').addClass(_ol.options.active);
            });
    Severity: Major
    Found in src/Resources/assets/js/social/social.js and 1 other location - About 2 hrs to fix
    src/Resources/assets/js/social/social.js on lines 56..58

    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 92.

    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

    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

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

                  var methods = {
                      init: function (){
                          if (!this.length) {
                              return false;
                          }
              Severity: Major
              Found in src/Resources/assets/js/textarea/textarea.js and 1 other location - About 2 hrs to fix
              src/Resources/assets/js/range/range.js on lines 60..72

              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 81.

              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 methods = {
                      init: function (){
                          if (!this.length) {
                              return false;
                          }
              Severity: Major
              Found in src/Resources/assets/js/range/range.js and 1 other location - About 2 hrs to fix
              src/Resources/assets/js/textarea/textarea.js on lines 64..76

              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 81.

              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

              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

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

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

                    protected function initialize()
                    {
                        //Admin panel
                        if (!OLZ_ISADMIN) {
                            return;
                Severity: Minor
                Found in src/Core/Menu/MenuTemplate.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

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

                    public function addTerm($configs = array())
                    {
                        //Admin panel
                        if (!OLZ_ISADMIN) {
                            return;
                Severity: Major
                Found in src/Core/Term/TermEngine.php and 1 other location - About 2 hrs to fix
                src/Core/PostType/PosttypeEngine.php on lines 71..94

                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 126.

                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

                    public function addPostType($configs = array())
                    {
                        //Admin panel
                        if (!OLZ_ISADMIN) {
                            return;
                Severity: Major
                Found in src/Core/PostType/PosttypeEngine.php and 1 other location - About 2 hrs to fix
                src/Core/Term/TermEngine.php on lines 59..82

                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 126.

                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

                Method defineLabels has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function defineLabels($ctn, $hierarchical = false)
                    {
                        $labels = array(
                            'name' => $ctn['name'],
                            'singular_name' => isset($ctn['singular_name']) && !empty($ctn['singular_name']) 
                Severity: Major
                Found in src/Core/Term/TermHook.php - About 2 hrs to fix

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

                          if ('top' == _ol.options.position) {
                              _ol.$tooltip.addClass('arrow-bottom');
                  
                              //top
                              return {
                  Severity: Major
                  Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 2 hrs to fix
                  src/Resources/assets/js/tooltip/tooltip.js on lines 153..179

                  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 77.

                  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

                          else if ('bottom' == _ol.options.position) {
                              _ol.$tooltip.addClass('arrow-top');
                  
                              //bottom
                              return {
                  Severity: Major
                  Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 2 hrs to fix
                  src/Resources/assets/js/tooltip/tooltip.js on lines 144..179

                  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 77.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language