TeaThemeOptions/TeaThemeOptions

View on GitHub

Showing 112 of 177 total issues

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

    public function addMenu($configs = array())
    {
        //Admin panel
        if (!OLZ_ISADMIN) {
            return;
Severity: Minor
Found in src/Core/Menu/MenuEngine.php - About 1 hr to fix

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

    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 tplFields has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

        Method hookAdminBar has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

              public function initialize()
              {
                  //Get capabilities
                  $capabilities = OlympusZeus::getConfigs('capabilities', 'backend');
          
          
          Severity: Minor
          Found in src/Core/Action/Action.php - About 1 hr to fix

            Method addDocumentPost has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function addDocumentPost($post)
                {
                    global $blog_id;
            
                    //Create document
            Severity: Minor
            Found in src/Plugins/Search/SearchElastica.php - About 1 hr to fix

              Method initialize has 28 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/MenuEngine.php - About 1 hr to fix

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

                    public function initialize()
                    {
                        //Get capabilities
                        $capabilities = OlympusZeus::getConfigs('capabilities', 'backend');
                
                
                Severity: Minor
                Found in src/Core/Action/Action.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 hookSaveItem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function hookSaveItem($post_id)
                    {
                        //Check post param
                        if (is_object($post_id)) {
                            //Got the WP post object with all datas
                Severity: Minor
                Found in src/Plugins/Search/SearchEngine.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 updateFooter has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function updateFooter($make = 'capabilities')
                    {
                        //Admin panel
                        if (!OLZ_ISADMIN) {
                            return;
                Severity: Minor
                Found in src/Core/Action/Action.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 connection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function connection()
                    {
                        //Check if we are in admin panel
                        if (!OLZ_ISADMIN) {
                            return;
                Severity: Minor
                Found in src/Plugins/Search/SearchElastica.php - About 1 hr to fix

                  Function _create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      OlSocial.prototype._create = function (nwk, $button){
                          var _ol = this;
                  
                          //check if network is already added
                          if (_ol.$el.find(_ol.options.items + '[data-nk="' + nwk + '"]').length) {
                  Severity: Minor
                  Found in src/Resources/assets/js/social/social.js - About 1 hr to fix

                    Method setPostTypes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function setPostTypes($pts)
                        {
                            //Define post types
                            $this->posttypes = $pts;
                    
                    
                    Severity: Minor
                    Found in src/Core/PostType/PosttypeHook.php - About 1 hr to fix

                      Method hookFieldsDisplay has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function hookFieldsDisplay($term)
                          {
                              //Definitions
                              $contents = array();
                              $ids = array();
                      Severity: Minor
                      Found in src/Core/Term/TermHook.php - About 1 hr to fix

                        Function hookFieldsPermalink has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function hookFieldsPermalink()
                            {
                                if (empty($this->posttypes)) {
                                    return false;
                                }
                        Severity: Minor
                        Found in src/Core/PostType/PosttypeHook.php - About 55 mins 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 tplFields has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function tplFields($contents)
                            {
                                //Admin panel
                                if (!OLZ_ISADMIN) {
                                    return;
                        Severity: Minor
                        Found in src/Core/Menu/MenuTemplate.php - About 55 mins 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 searchContents has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function searchContents()
                            {
                                //Return array
                                $return = array(
                                    'query' => array(
                        Severity: Minor
                        Found in src/Plugins/Search/SearchElastica.php - About 55 mins 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 connection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function connection()
                            {
                                //Check if we are in admin panel
                                if (!OLZ_ISADMIN) {
                                    return;
                        Severity: Minor
                        Found in src/Plugins/Search/SearchElastica.php - About 55 mins 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 makeHooks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function makeHooks()
                            {
                                //Admin panel
                                if (!OLZ_ISADMIN) {
                                    return;
                        Severity: Minor
                        Found in src/Core/Hook/HookBackend.php - About 45 mins 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