iranianpep/code-jetter

View on GitHub

Showing 251 of 1,173 total issues

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

    public function pluralToSingular($string)
    {
        // save some time in the case that singular and plural are the same
        if (in_array(strtolower($string), $this->uncountable)) {
            return $string;
Severity: Minor
Found in core/utility/StringUtility.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 mapRowsToObjects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function mapRowsToObjects(array $rows, array $tables = [])
    {
        /**
         * Initialize $mappedObjects.
         */
Severity: Minor
Found in core/BaseMapper.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 addRequiredRule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function addRequiredRule()
    {
        $inputs = $this->getDefinedInputs();
        if (!empty($inputs)) {
            foreach ($inputs as $input) {
Severity: Minor
Found in core/security/Validator.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 insertQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function insertQuery(array $fieldsValues)
    {
        if (empty($fieldsValues)) {
            throw new \Exception('fieldsValues cannot be empty in insertQuery function');
        }
Severity: Minor
Found in core/database/QueryMaker.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 $output;
Severity: Major
Found in components/user/models/User.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return (new UserAuthentication())->forgetPassword($user);
    Severity: Major
    Found in components/user/models/User.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $output;
      Severity: Major
      Found in components/user/mappers/UserMapper.php - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
        Severity: Major
        Found in public/scripts/bootstrap.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return false
          Severity: Major
          Found in public/scripts/bootstrap.js - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $loggedIn[$roles[$routeInfo->getAccessRole()]['user']];
            Severity: Major
            Found in components/user/services/UserAuthentication.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return $output;
              Severity: Major
              Found in components/user/services/UserAuthentication.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return (new UserAuthentication())->resetPassword($user, $resetPasswordToken, $password, $passwordConfirmation);
                Severity: Major
                Found in components/user/models/User.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $output;
                  Severity: Major
                  Found in components/user/models/User.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return $finalOutput;
                    Severity: Major
                    Found in components/user/services/UserAuthentication.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $output;
                      Severity: Major
                      Found in core/security/Validator.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return true;
                        Severity: Major
                        Found in components/user/services/UserAuthentication.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return false;
                          Severity: Major
                          Found in core/ErrorHandler.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return true;
                            Severity: Major
                            Found in core/ErrorHandler.php - About 30 mins to fix

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

                                  public function batchDeleteGroup()
                                  {
                                      $inputs = (new Request('POST'))->getInputs();
                              
                                      /**
                              Severity: Minor
                              Found in components/user/controllers/MemberGroupController.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 batchDeleteMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function batchDeleteMessage()
                                  {
                                      $inputs = (new Request('POST'))->getInputs();
                              
                                      /**
                              Severity: Minor
                              Found in components/contact/controllers/ContactController.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