strata-mvc/strata

View on GitHub

Showing 146 of 158 total issues

Method trace has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function trace($backtrace = null, $options = array())
    {
        if (is_null($backtrace)) {
            $backtrace = debug_backtrace();
        }
Severity: Minor
Found in src/Logger/Debugger.php - About 1 hr to fix

    Method writeThemesDocumentation has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function writeThemesDocumentation($info)
        {
            $header = '<!DOCTYPE html><html><head><meta charset="utf-8"><title>Overview</title>';
            $header .= '<link rel="stylesheet" href="../api/resources/style.css">';
            $header .= '</head><body><div id="content">';
    Severity: Minor
    Found in src/Shell/Command/DocumentationCommand.php - About 1 hr to fix

      Method rules has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function rules($type, $rules, $reset = false)
          {
              $var = '_' . $type;
      
              switch ($type) {
      Severity: Minor
      Found in src/Utility/Inflector.php - About 1 hr to fix

        Method wordWrap has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function wordWrap($text, $width = 72, $break = "\n", $cut = false)
            {
                if ($cut) {
                    $parts = array();
                    while (mb_strlen($text) > 0) {
        Severity: Minor
        Found in src/Utility/StringUtility.php - About 1 hr to fix

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

              public static function expand($data, $separator = '.')
              {
                  $result = array();
          
                  $stack = array();
          Severity: Minor
          Found in src/Utility/Hash.php - About 1 hr to fix

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

            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 relationsToQueries has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function relationsToQueries()
                {
                    foreach ($this->filters['strata_relations'] as $queryType => $queryDetails) {
                        // At this point, there should only be exclusive AND or OR query groups
                        $metaQueries = null;
            Severity: Minor
            Found in src/Model/CustomPostType/Query.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 trace has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function trace($backtrace = null, $options = array())
                {
                    if (is_null($backtrace)) {
                        $backtrace = debug_backtrace();
                    }
            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

            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 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 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 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 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 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 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 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 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 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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language