atelierspierrot/library

View on GitHub

Showing 159 of 159 total issues

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

    public static function getOptionHelp($arg, $caller)
    {
        if (!is_object($caller) || !($caller instanceof CommandLineControllerInterface)) {
            throw new InvalidArgumentException(
                sprintf('Argument 2 for method "%s::getOptionHelp" must be an object and implement the "CommandLineControllerInterface" interface!', __CLASS__)
Severity: Minor
Found in src/Library/CommandLine/Helper.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 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 null;
    Severity: Major
    Found in src/Library/Factory.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return null;
      Severity: Major
      Found in src/Library/Factory.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $_cls;
        Severity: Major
        Found in src/Library/Factory.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 null;
            Severity: Major
            Found in src/Library/Helper/Number.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

                Function fetch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function fetch($display = true, $exit = false, $last_nl = true)
                    {
                        $str='';
                        if (!empty($this->messages)) {
                            foreach($this->messages as $i=>$_message) {
                Severity: Minor
                Found in src/Library/CommandLine/Formater.php - About 25 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 isJollyJumperSeries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function isJollyJumperSeries(array $items = array())
                    {
                        if (empty($items)) {
                            return null;
                        }
                Severity: Minor
                Found in src/Library/Helper/Number.php - About 25 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 getUniqFilename has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getUniqFilename($filename = '', $dir = null, $force_file = true, $extension = 'txt')
                    {
                        if (empty($filename)) {
                            return '';
                        }
                Severity: Minor
                Found in src/Library/Helper/File.php - About 25 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 setData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function setData($value, $arg2 = null)
                    {
                        if (!is_null($arg2)) {
                            return $this->__set($value, $arg2);
                        } else {
                Severity: Minor
                Found in src/Library/Object/RegistryInvokable.php - About 25 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 touch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function touch($file_path = null, array &$logs = array())
                    {
                        if (is_null($file_path)) {
                            return null;
                        }
                Severity: Minor
                Found in src/Library/Helper/File.php - About 25 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 cut has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function cut($string = '', $length = 120, $end_str = ' ...')
                    {
                        if (empty($string)) {
                            return '';
                        }
                Severity: Minor
                Found in src/Library/Helper/Text.php - About 25 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 __callStatic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function __callStatic($name, array $arguments)
                    {
                        $return = null;
                
                        // unset, isset, reset
                Severity: Minor
                Found in src/Library/Object/AbstractInvokable.php - About 25 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 remove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function remove($file_path = null, array &$logs = array())
                    {
                        if (is_null($file_path)) {
                            return null;
                        }
                Severity: Minor
                Found in src/Library/Helper/File.php - About 25 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 mustRotate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function mustRotate()
                    {
                        if (!file_exists($this->file_path)) return false;
                
                        if ($this->flag & self::ROTATE_FILESIZE) {
                Severity: Minor
                Found in src/Library/Tool/FileRotator.php - About 25 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 renderMulti has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function renderMulti($content, $tag_type = 'default', array $multi = array(), $args = null, $placeholder_mask = '@%s@')
                    {
                        if (is_null($args)) $args = array();
                        if (!is_array($args)) $args = array( $args );
                
                
                Severity: Minor
                Found in src/Library/Reporter/Reporter.php - About 25 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 urlEncode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function urlEncode($str = null, $keep_mask = true)
                    {
                        if (
                            (!empty($str) && is_numeric($str)) ||
                            (true===$keep_mask && $str==='%s')
                Severity: Minor
                Found in src/Library/Router.php - About 25 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