strata-mvc/strata

View on GitHub

Showing 158 of 158 total issues

Method _simpleOp has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected static function _simpleOp($op, $data, $path, $values = null)
    {
        $_list =& $data;

        $count = count($path);
Severity: Minor
Found in src/Utility/Hash.php - About 1 hr to fix

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

        public function addResourcePossibility(WordpressEntity $model)
        {
            $slug = null;
    
            if (property_exists($model, "routed") && is_array($model->routed) &&  array_key_exists("controller", $model->routed)) {
    Severity: Minor
    Found in src/Router/RouteParser/Url/UrlRoute.php - About 1 hr to fix

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

          public function send()
          {
              $useHtml = (bool)$this->getConfig("use_html");
      
              $mergedHeaders = $this->getMergedHeaders();
      Severity: Minor
      Found in src/Model/Mailer.php - About 1 hr to fix

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

            public function register()
            {
                $debugLevel = $this->getDebugLevel();
        
                if ($this->shouldBeDebugging()) {
        Severity: Minor
        Found in src/Error/BaseErrorHandler.php - About 1 hr to fix

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

              public static function pluralize($word)
              {
                  if (isset(self::$_cache['pluralize'][$word])) {
                      return self::$_cache['pluralize'][$word];
                  }
          Severity: Minor
          Found in src/Utility/Inflector.php - About 1 hr to fix

            Method highlight has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function highlight($text, $phrase, $options = array())
                {
                    if (empty($phrase)) {
                        return $text;
                    }
            Severity: Minor
            Found in src/Utility/StringUtility.php - About 1 hr to fix

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

                  public static function pluralize($word)
                  {
                      if (isset(self::$_cache['pluralize'][$word])) {
                          return self::$_cache['pluralize'][$word];
                      }
              Severity: Minor
              Found in src/Utility/Inflector.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 extractLocalizedInformation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function extractLocalizedInformation()
                  {
                      if ($this->modelSupportsRewrites()) {
                          foreach ($this->getLocales() as $locale) {
              
              
              Severity: Minor
              Found in src/Router/Registrar/CustomPostTypeRouteMaker.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 exportArray has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected static function exportArray(array $var, $depth = 1, $indent = 0)
                  {
                      $out = "[";
                      $break = $end = null;
                      if (!empty($var)) {
              Severity: Minor
              Found in src/Logger/Debugger.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 singularize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function singularize($word)
                  {
                      if (isset(self::$_cache['singularize'][$word])) {
                          return self::$_cache['singularize'][$word];
                      }
              Severity: Minor
              Found in src/Utility/Inflector.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 flatten has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function flatten(array $data, $separator = '.')
                  {
                      $result = array();
                      $stack = array();
                      $path = null;
              Severity: Minor
              Found in src/Utility/Hash.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 stackTrace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  function stackTrace(array $options = array())
                  {
                      if (!WP_DEBUG) {
                          return;
                      }
              Severity: Minor
              Found in src/Utility/Toolset.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 remove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function remove(array $data, $path)
                  {
                      if (strpos($path, '[') === false) {
                          $tokens = explode('.', $path);
                      } else {
              Severity: Minor
              Found in src/Utility/Hash.php - About 1 hr to fix

                Method generateCommand has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function generateCommand()
                    {
                        $namespace = Strata::getNamespace() . "\\Shell\\Command";
                        $destination = implode(DIRECTORY_SEPARATOR, array("src", "Shell", "Command", "{$this->classname}.php"));
                
                
                Severity: Minor
                Found in src/Shell/Command/Generator/CommandGenerator.php - About 1 hr to fix

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

                      function debug()
                      {
                          if (!WP_DEBUG) {
                              return;
                          }
                  Severity: Minor
                  Found in src/Utility/Toolset.php - About 1 hr to fix

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

                        function breakpoint()
                        {
                            if (!WP_DEBUG) {
                                return;
                            }
                    Severity: Minor
                    Found in src/Utility/Toolset.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 load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function load()
                        {
                            // Even though we can't confirm the entity has
                            // been loaded, we should still inform the user.
                            $this->logAutoloadedEntities();
                    Severity: Minor
                    Found in src/Model/CustomPostType/CustomPostTypeLoader.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 insert has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function insert($str, $data, $options = array())
                        {
                            $defaults = array(
                                'before' => ':', 'after' => null, 'escape' => '\\', 'format' => null, 'clean' => false
                            );
                    Severity: Minor
                    Found in src/Utility/StringUtility.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 canCatchTheError has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function canCatchTheError($triggerFilePath = '')
                        {
                            if (function_exists("is_admin") && is_admin()) {
                                if (!class_exists("\Strata\Router\Router")) {
                                    return false;
                    Severity: Minor
                    Found in src/Error/BaseErrorHandler.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 parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function parse()
                        {
                            // Fetch the basic values from possible user defined values.
                            if ($this->entity->hasConfig("labels")) {
                                if ($this->entity->hasConfig("labels.singular_name")) {
                    Severity: Minor
                    Found in src/Model/CustomPostType/LabelParser.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

                    Severity
                    Category
                    Status
                    Source
                    Language