gjerokrsteski/pimf-framework

View on GitHub
core/Pimf/Error.php

Summary

Maintainability
A
0 mins
Test Coverage

Method format has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

    public static function format(\Exception $exception, $isCli = false)
    {
        if ($isCli === true) {
            return
                "+++ Untreated Exception +++" . PHP_EOL . "Message: " . $exception->getMessage() . PHP_EOL . "Location: " . $exception->getFile()
Severity: Minor
Found in core/Pimf/Error.php - About 1 hr to fix

    Method native has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Wontfix

        public static function native($code, $error, $file, $line, Logger $logger, $reporting, $exit = true)
    Severity: Major
    Found in core/Pimf/Error.php - About 50 mins to fix

      Function exception has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Wontfix

          public static function exception(\Exception $exception, Logger $logger, $exit = true)
          {
              static::log($exception, $logger);
      
              ob_get_length() > 0 && ob_get_level() && ob_end_clean();
      Severity: Minor
      Found in core/Pimf/Error.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

      There are no issues that match your filters.

      Category
      Status