FlameCore/Infernum

View on GitHub

Showing 41 of 41 total issues

Method parse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function parse($path)
    {
        if (empty($path)) {
            return false;
        }
Severity: Minor
Found in libraries/Router.php - About 1 hr to fix

    Method createCookie has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function createCookie($name, $value = null, $expire = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
    Severity: Major
    Found in libraries/Application.php - About 50 mins to fix

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

          public static function connect($driver, $host = 'localhost', $user = 'root', $password = '', $database, array $options = [])
      Severity: Minor
      Found in libraries/Database/Database.php - About 45 mins to fix

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

            public function validate($value)
            {
                if ($this->scheme) {
                    $value = (string) $value;
        
        
        Severity: Minor
        Found in libraries/UI/Form/Field/TextField.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 handleRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function handleRequest(Request $request)
            {
                if ($this->get('_submit')->retrieve($request) == $this->name) {
                    $this->submitted = true;
                }
        Severity: Minor
        Found in libraries/UI/Form/Form.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 toTimestamp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function toTimestamp($input)
            {
                if (is_numeric($input)) {
                    // Numeric input, we handle it as timestamp
                    return (int) $input;
        Severity: Minor
        Found in libraries/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 handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function handle(Request $request, Application $app)
            {
                if (!$this->isReady()) {
                    throw new \LogicException('Kernel must be booted to handle requests.');
                }
        Severity: Minor
        Found in libraries/Kernel.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 mountModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function mountModule($name, $alias = null, $extra = null)
            {
                if (!$this->kernel->moduleExists($name)) {
                    throw new \LogicException(sprintf('Cannot mount module "%s" since it does not exist.', $name));
                }
        Severity: Minor
        Found in libraries/Router.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 encode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function encode($value)
            {
                if (is_bool($value)) {
                    return (int) $value;
                } elseif (is_scalar($value)) {
        Severity: Minor
        Found in libraries/Database/AbstractStatement.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 implode(',', $value);
        Severity: Major
        Found in libraries/Database/AbstractStatement.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $value;
          Severity: Major
          Found in libraries/Resource/AbstractResource.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return unserialize($value);
            Severity: Major
            Found in libraries/Resource/AbstractResource.php - About 30 mins to fix

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

                  public function setMinimum($minimum)
                  {
                      if ($minimum === null) {
                          $this->minimum = null;
                      } elseif ($minimum = $this->normalize($minimum)) {
              Severity: Minor
              Found in libraries/UI/Form/Field/DateField.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 decode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected static function decode($value, $type)
                  {
                      if ($type == 'int') {
                          return (int) $value;
                      } elseif ($type == 'float') {
              Severity: Minor
              Found in libraries/Resource/AbstractResource.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function get($name)
                  {
                      if (!$this->validateName($name)) {
                          throw new \InvalidArgumentException(sprintf('Given cache name "%s" is invalid.', $name));
                      }
              Severity: Minor
              Found in libraries/Cache.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 makeFileUrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function makeFileUrl($filename, $fromExtension = false)
                  {
                      if ($fromExtension) {
                          $extension = $this->kernel->getRunningExtension();
              
              
              Severity: Minor
              Found in libraries/Application.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 normalize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function normalize($value)
                  {
                      if ($value instanceof \DateTime) {
                          return $value;
                      } elseif (is_string($value) && preg_match('/\d{4}-\d{2}-\d{2}/', $value)) {
              Severity: Minor
              Found in libraries/UI/Form/Field/DateField.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 findFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function findFile($class)
                  {
                      $class = $this->normalize($class);
              
                      foreach ($this->sources as $prefix => $pattern) {
              Severity: Minor
              Found in libraries/ClassLoader.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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct($sid, Application $app)
                  {
                      $sql = 'SELECT * FROM <PREFIX>sessions WHERE id = ? AND expire > ? LIMIT 1';
                      $result = $app['db']->query($sql, [$sid, date('Y-m-d H:i:s')]);
              
              
              Severity: Minor
              Found in libraries/Session.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 select has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function select($table, $columns = '*', array $params = [])
                  {
                      if (is_array($columns)) {
                          $columns = implode(', ', array_map([$this, 'quoteField'], $columns));
                      } elseif ($columns != '*') {
              Severity: Minor
              Found in libraries/Database/MySQL/MySQLDriver.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