Showing 44 of 44 total issues

Function addHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function addHandler($handler) : MacroProcessor
    {
        if (is_callable($handler)){
            $this->handlers[] = $handler;
        }
Severity: Minor
Found in src/MacroProcessor.php - About 45 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

Method dump has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function dump($var, string $format = 'html', int $back = 0, array $options = null, bool $return = false, int $max_depth = 6 ): ?string
Severity: Minor
Found in src/Util.php - About 45 mins to fix

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

        public function process(string $keyword) : string
        {
            foreach($this->handlers as $handler){
                if (is_callable($handler)){
                    $keyword = $handler($keyword);
    Severity: Minor
    Found in src/handler/CombinedMacroHandler.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 stripSlashes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function stripSlashes( $value )
        {
            if ( is_string($value) ){
                return stripslashes($value);
            }
    Severity: Minor
    Found in src/Util.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 stripTags has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function stripTags($value, string $allowable_tags = null)
        {
            if ( is_string($value) ){
                return strip_tags($value, $allowable_tags);
            }
    Severity: Minor
    Found in src/Util.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 escape has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function escape( $value )
        {
            if ( is_string($value) ){
                return htmlspecialchars($value, ENT_QUOTES, mb_internal_encoding());
            }
    Severity: Minor
    Found in src/Util.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 date('d');
    Severity: Major
    Found in src/handler/DateMacroHandler.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return date('n');
      Severity: Major
      Found in src/handler/DateMacroHandler.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return date('h');
        Severity: Major
        Found in src/handler/DateMacroHandler.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return intval($number);
          Severity: Major
          Found in src/MemoryUtil.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return date('j');
            Severity: Major
            Found in src/handler/DateMacroHandler.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return date('s');
              Severity: Major
              Found in src/handler/DateMacroHandler.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return sprintf("%06d",($t - floor($t)) * 1000000);
                Severity: Major
                Found in src/handler/DateMacroHandler.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return get_class( $value ) . '(hash=' . $value->hash() . ')';
                  Severity: Major
                  Found in src/Util.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return date('i');
                    Severity: Major
                    Found in src/handler/DateMacroHandler.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $keyword;
                      Severity: Major
                      Found in src/handler/DateMacroHandler.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return get_class( $value ) . '(' . count($value) . ')';
                        Severity: Major
                        Found in src/Util.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return intval($size_string);
                          Severity: Major
                          Found in src/MemoryUtil.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return date('H');
                            Severity: Major
                            Found in src/handler/DateMacroHandler.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return round( ((float)$value) / self::BYTES_TB, $precision );
                              Severity: Major
                              Found in src/MemoryUtil.php - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language