atelierspierrot/library

View on GitHub
src/Library/Helper/Directory.php

Summary

Maintainability
D
2 days
Test Coverage

Function chmod has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public static function chmod(
        $path = null, $mode = self::DEFAULT_UNIX_CHMOD_DIRECTORIES,
        $recursive = true, $file_mode = self::DEFAULT_UNIX_CHMOD_FILES, array &$logs = array()
    ){
        if (is_null($path)) {
Severity: Minor
Found in src/Library/Helper/Directory.php - About 5 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

Function purge has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static function purge($path = null, array &$logs = array())
    {
        if (is_null($path)) {
            return null;
        }
Severity: Minor
Found in src/Library/Helper/Directory.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

Function remove has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public static function remove($path = null, array &$logs = array())
    {
        if (is_null($path)) {
            return null;
        }
Severity: Minor
Found in src/Library/Helper/Directory.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 chmod has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function chmod(
        $path = null, $mode = self::DEFAULT_UNIX_CHMOD_DIRECTORIES,
        $recursive = true, $file_mode = self::DEFAULT_UNIX_CHMOD_FILES, array &$logs = array()
    ){
        if (is_null($path)) {
Severity: Minor
Found in src/Library/Helper/Directory.php - About 1 hr to fix

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

        public static function purge($path = null, array &$logs = array())
        {
            if (is_null($path)) {
                return null;
            }
    Severity: Minor
    Found in src/Library/Helper/Directory.php - About 1 hr to fix

      Method remove has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function remove($path = null, array &$logs = array())
          {
              if (is_null($path)) {
                  return null;
              }
      Severity: Minor
      Found in src/Library/Helper/Directory.php - About 1 hr to fix

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

                $path = null, $mode = self::DEFAULT_UNIX_CHMOD_DIRECTORIES,
                $recursive = true, $file_mode = self::DEFAULT_UNIX_CHMOD_FILES, array &$logs = array()
        Severity: Minor
        Found in src/Library/Helper/Directory.php - About 35 mins to fix

          Avoid too many return statements within this method.
          Open

                              return true;
          Severity: Major
          Found in src/Library/Helper/Directory.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $ok;
            Severity: Major
            Found in src/Library/Helper/Directory.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return false;
              Severity: Major
              Found in src/Library/Helper/Directory.php - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status