symphonycms/symphony-2

View on GitHub
symphony/content/content.login.php

Summary

Maintainability
D
2 days
Test Coverage

Function view has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    public function view()
    {
        if (isset($this->_context['token']) && $this->_context['action'] === 'reset-password') {
            if (Administration::instance()->loginFromToken($this->_context['token'])) {
                if (Administration::instance()->isLoggedIn()) {
Severity: Minor
Found in symphony/content/content.login.php - About 5 hrs 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 view has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function view()
    {
        if (isset($this->_context['token']) && $this->_context['action'] === 'reset-password') {
            if (Administration::instance()->loginFromToken($this->_context['token'])) {
                if (Administration::instance()->isLoggedIn()) {
Severity: Major
Found in symphony/content/content.login.php - About 3 hrs to fix

    Method action has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function action()
        {
            if (isset($_POST['action'])) {
                $actionParts = array_keys($_POST['action']);
                $action = end($actionParts);
    Severity: Major
    Found in symphony/content/content.login.php - About 3 hrs to fix

      Function action has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function action()
          {
              if (isset($_POST['action'])) {
                  $actionParts = array_keys($_POST['action']);
                  $action = end($actionParts);
      Severity: Minor
      Found in symphony/content/content.login.php - About 2 hrs 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 parseContext has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function parseContext(array &$context, array $parts)
          {
              if (isset($parts[1])) {
                  if ($parts[1] === 'retrieve-password') {
                      $context['action'] = $parts[1];
      Severity: Minor
      Found in symphony/content/content.login.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

      There are no issues that match your filters.

      Category
      Status