TeaThemeOptions/TeaThemeOptions

View on GitHub

Showing 112 of 177 total issues

Avoid too many return statements within this method.
Open

        return $return;
Severity: Major
Found in src/Plugins/Search/SearchElastica.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return array($posttype, $slug);
    Severity: Major
    Found in src/Core/PostType/PosttypeHook.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return 0;
      Severity: Major
      Found in src/Plugins/Search/SearchElastica.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $error;
        Severity: Major
        Found in src/Core/Field/Field.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return;
          Severity: Major
          Found in src/Core/Term/TermHook.php - About 30 mins to fix

            Function registerTerm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function registerTerm($term = array())
                {
                    //Check post types
                    if (empty($term)) {
                        return array();
            Severity: Minor
            Found in src/Core/Term/TermHook.php - About 25 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 hookAdminBar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function hookAdminBar()
                {
                    //Admin panel
                    if (!OLZ_ISADMIN) {
                        return;
            Severity: Minor
            Found in src/Core/Menu/MenuEngine.php - About 25 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 searchChildren has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function searchChildren($type, $parent, $order = 'desc')
                {
                    //Check page
                    if (is_search()) {
                        return;
            Severity: Minor
            Found in src/Plugins/Search/SearchElastica.php - About 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function initialize($request, $searchengine)
                {
                    //Admin panel
                    if (!OLZ_ISADMIN) {
                        return;
            Severity: Minor
            Found in src/Plugins/Search/SearchAction.php - About 25 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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($configs, $hook)
                {
                    //Initialize Elastica
                    $this->setConfig($configs);
            
            
            Severity: Minor
            Found in src/Plugins/Search/SearchEngine.php - About 25 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 prepareField has a Cognitive Complexity of 6 (exceeds 5 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 25 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 hookAdminMenu has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function hookAdminMenu()
                {
                    //Admin panel
                    if (!OLZ_ISADMIN) {
                        return;
            Severity: Minor
            Found in src/Core/Menu/MenuEngine.php - About 25 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