TeaThemeOptions/TeaThemeOptions

View on GitHub
src/Core/Hook/HookBackend.php

Summary

Maintainability
D
3 days
Test Coverage

Method wp_enqueue_media_olz has 231 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static function wp_enqueue_media_olz($args = array())
    {
        //Admin panel
        if (!OLZ_ISADMIN) {
            return;
Severity: Major
Found in src/Core/Hook/HookBackend.php - About 1 day to fix

    File HookBackend.php has 440 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace crewstyle\OlympusZeus\Core\Hook;
    
    use crewstyle\OlympusZeus\OlympusZeus;
    Severity: Minor
    Found in src/Core/Hook/HookBackend.php - About 6 hrs to fix

      Function wp_enqueue_media_olz has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          static function wp_enqueue_media_olz($args = array())
          {
              //Admin panel
              if (!OLZ_ISADMIN) {
                  return;
      Severity: Minor
      Found in src/Core/Hook/HookBackend.php - About 3 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 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

        Method makeHooks has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          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

          There are no issues that match your filters.

          Category
          Status