TeaThemeOptions/TeaThemeOptions

View on GitHub

Showing 112 of 177 total issues

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

Function hookFieldsDisplay has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function hookFieldsDisplay($term)
    {
        //Definitions
        $contents = array();
        $ids = array();
Severity: Minor
Found in src/Core/Term/TermHook.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

Function addDocumentPost has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addDocumentPost($post)
    {
        global $blog_id;

        //Create document
Severity: Minor
Found in src/Plugins/Search/SearchElastica.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

Function getField has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getField($type, $id, $special = array(), $ids = array())
    {
        //Admin panel
        if (!OLZ_ISADMIN) {
            return false;
Severity: Minor
Found in src/Core/Field/Field.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

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/HookFrontend.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

Method start_el has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
Severity: Minor
Found in src/Core/Walker/WalkerSingle.php - About 35 mins to fix

    Function getWPPosts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getWPPosts($options = array())
        {
            //Build contents
            $contents = array();
    
    
    Severity: Minor
    Found in src/Core/Field/Wordpress.php - About 35 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 getWPCategories has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getWPCategories($options = array())
        {
            //Build contents
            $contents = array();
    
    
    Severity: Minor
    Found in src/Core/Field/Wordpress.php - About 35 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 getWPPages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getWPPages($options = array())
        {
            //Build contents
            $contents = array();
    
    
    Severity: Minor
    Found in src/Core/Field/Wordpress.php - About 35 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 7 (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/Social.php - About 35 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 getWPMenus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getWPMenus($options = array())
        {
            //Build contents
            $contents = array();
    
    
    Severity: Minor
    Found in src/Core/Field/Wordpress.php - About 35 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

    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 $field;
      Severity: Major
      Found in src/Core/Field/Field.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;
          Severity: Major
          Found in src/Core/Term/TermHook.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

                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 $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 $return;
                    Severity: Major
                    Found in src/Plugins/Search/SearchElastica.php - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language