atelierspierrot/library

View on GitHub

Showing 148 of 159 total issues

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