iranianpep/code-jetter

View on GitHub

Showing 251 of 1,173 total issues

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

    public function viewMember()
    {
        $urlParameters = $this->getURLParameters();

        if (empty($urlParameters['id'])) {
Severity: Minor
Found in components/user/controllers/AdminUserController.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

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

    public function resetPassword(User $user, $token, $password, $passwordConfirmation)
    {
        $output = new Output();
        /**
         * Start validating passwords - email & resetPasswordToken are already validated.
Severity: Minor
Found in components/user/services/UserAuthentication.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

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

    private function mapRowToObject(array $row, array $tables = [])
    {
        /**
         * Initialize $mappedObject.
         */
Severity: Minor
Found in core/BaseMapper.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

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

    public function updateXref(array $oldXrefs, array $newXrefs)
    {
        $result = (new ArrayUtility())->arrayComparison($oldXrefs, $newXrefs);

        if (!empty($result['toBeDeleted'])) {
Severity: Minor
Found in core/database/BaseXrefMapper.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

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

    public function __construct()
    {
        // True means throwing error if there is any
        $mailer = new PHPMailer(true);

Severity: Minor
Found in core/Mailer.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 getStatesCitiesGroupedByStates has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        array $criteria = [],
        $order = null,
        $start = 0,
        $limit = 0,
        $excludeArchived = true
Severity: Minor
Found in components/geolocation/mappers/StateMapper.php - About 35 mins to fix

    Method getAll has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getAll(array $criteria = [], array $fromColumns = [], $order = null, $start = 0, $limit = 0);
    Severity: Minor
    Found in core/ICrud.php - About 35 mins to fix

      Method batchBindValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              \PDOStatement $statement,
              array $criteria,
              $start = 0,
              $limit = 0,
              array $fieldsValuesCollection = []
      Severity: Minor
      Found in core/database/QueryMaker.php - About 35 mins to fix

        Method authorizeRoute has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function authorizeRoute($accessRole, $rootNamespace, $component, $controller, $redirect = true)
        Severity: Minor
        Found in core/Router.php - About 35 mins to fix

          Method selectQuery has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function selectQuery(array $criteria = [], $fromColumns = '*', $order = '', $start = 0, $limit = 0)
          Severity: Minor
          Found in core/database/QueryMaker.php - About 35 mins to fix

            Method bindValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function bindValues(\PDOStatement $statement, array $criteria, $start = 0, $limit = 0, array $fieldsValues = [])
            Severity: Minor
            Found in core/database/QueryMaker.php - About 35 mins to fix

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

                  public function getOneByName($name, $status = null, $excludeArchived = true)
                  {
                      /**
                       * Start validating.
                       */
              Severity: Minor
              Found in components/user/mappers/GroupMapper.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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function add(array $inputs, array $fieldsValues = [], $extraDefinedInputs = [])
                  {
                      /**
                       * Start validating.
                       */
              Severity: Minor
              Found in components/user/mappers/MemberGroupMapper.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 getGroupIds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getGroupIds()
                  {
                      if (isset($this->groupIds)) {
                          return $this->groupIds;
                      }
              Severity: Minor
              Found in components/user/models/MemberUser.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 populateFormWithDataObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function populateFormWithDataObject(data, form)
              {
                  if (typeof data != "undefined" && typeof form != "undefined") {
                      // for each variable / property in data object
                      for (var name in data) {
              Severity: Minor
              Found in public/scripts/script.js - 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 getOneByUsername has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getOneByUsername($username, $status = null, $excludeArchived = true)
                  {
                      /**
                       * start validating.
                       */
              Severity: Minor
              Found in components/user/mappers/UserMapper.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 generateHeadRowByListHeaders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function generateHeadRowByListHeaders(array $headers)
                  {
                      $headRow = new Row();
              
                      /**
              Severity: Minor
              Found in core/utility/HtmlUtility.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 getMessages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getMessages($prepareForView = true)
                  {
                      if ($prepareForView === true) {
                          $stringUtility = new StringUtility();
                          $messages = $this->messages;
              Severity: Minor
              Found in core/io/Output.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 getAdditionalMetaTagsHtml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getAdditionalMetaTagsHtml()
                  {
                      $metaTags = $this->getPage()->getMetaTags();
              
                      $metaTagsHtml = '';
              Severity: Minor
              Found in core/layout/blocks/Header.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 singularToPlural has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function singularToPlural($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

              Severity
              Category
              Status
              Source
              Language