strata-mvc/strata

View on GitHub

Showing 146 of 158 total issues

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

    public static function cleanInsert($str, $options)
    {
        $clean = $options['clean'];
        if (!$clean) {
            return $str;
Severity: Minor
Found in src/Utility/StringUtility.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 mergeDiff has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function mergeDiff(array $data, $compare)
    {
        if (empty($data) && !empty($compare)) {
            return $compare;
        }
Severity: Minor
Found in src/Utility/Hash.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 extractGettextStrings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function extractGettextStrings()
    {
        $translation = null;
        $translationObjects = array();
        $lookupDirectories = array(
Severity: Minor
Found in src/Shell/Command/I18nCommand.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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function create($last = false)
    {
        if (!file_exists($this->destination)) {
            $dir = dirname($this->destination);
            if (!is_dir($dir)) {
Severity: Minor
Found in src/Shell/Command/Generator/ClassWriter.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 _squash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function _squash($data, $key = null)
    {
        $stack = array();
        foreach ($data as $k => $r) {
            $id = $k;
Severity: Minor
Found in src/Utility/Hash.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 $label . "\n" . $this->generateTextinput($options, $currentValue) . $errorHtml . "\n";
Severity: Major
Found in src/View/Helper/FormHelper.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $this->setLocale($this->getDefaultLocale());
    Severity: Major
    Found in src/I18n/I18n.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return strtolower(gettype($var));
      Severity: Major
      Found in src/Logger/Debugger.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return 'boolean';
        Severity: Major
        Found in src/Logger/Debugger.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                                  return $this->setLocale($locale);
          Severity: Major
          Found in src/I18n/I18n.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return $label . "\n" . $this->generateHidden($options, $currentValue) . $errorHtml . "\n";
            Severity: Major
            Found in src/View/Helper/FormHelper.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return 'float';
              Severity: Major
              Found in src/Logger/Debugger.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return $this->setLocale($locale);
                Severity: Major
                Found in src/I18n/I18n.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return 'integer';
                  Severity: Major
                  Found in src/Logger/Debugger.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return "'" . $var . "'";
                    Severity: Major
                    Found in src/Logger/Debugger.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return static::exportObject($var, $depth - 1, $indent + 1);
                      Severity: Major
                      Found in src/Logger/Debugger.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return new TaxonomyGenerator($this);
                        Severity: Major
                        Found in src/Shell/Command/GenerateCommand.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return array_combine($keys, $vals);
                          Severity: Major
                          Found in src/Utility/Hash.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return static::exportArray($var, $depth - 1, $indent + 1);
                            Severity: Major
                            Found in src/Logger/Debugger.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return new CommandGenerator($this);
                              Severity: Major
                              Found in src/Shell/Command/GenerateCommand.php - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language