modxcms/revolution

View on GitHub
manager/controllers/default/security/user/update.class.php

Summary

Maintainability
B
5 hrs
Test Coverage

Function _parseCustomData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private function _parseCustomData(array $remoteData = array(),$path = '') {
        $usemb = function_exists('mb_strlen') && (boolean)$this->modx->getOption('use_multibyte',null,false);
        $encoding = $this->modx->getOption('modx_charset',null,'UTF-8');
        $fields = array();
        foreach ($remoteData as $key => $value) {
Severity: Minor
Found in manager/controllers/default/security/user/update.class.php - About 1 hr 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 process has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(array $scriptProperties = array()) {
        $placeholders = array();

        /* get user */
        if (empty($scriptProperties['id']) || strlen($scriptProperties['id']) !== strlen((integer)$scriptProperties['id'])) {
Severity: Minor
Found in manager/controllers/default/security/user/update.class.php - About 1 hr to fix

    Method _parseCustomData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function _parseCustomData(array $remoteData = array(),$path = '') {
            $usemb = function_exists('mb_strlen') && (boolean)$this->modx->getOption('use_multibyte',null,false);
            $encoding = $this->modx->getOption('modx_charset',null,'UTF-8');
            $fields = array();
            foreach ($remoteData as $key => $value) {
    Severity: Minor
    Found in manager/controllers/default/security/user/update.class.php - About 1 hr to fix

      Function process has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function process(array $scriptProperties = array()) {
              $placeholders = array();
      
              /* get user */
              if (empty($scriptProperties['id']) || strlen($scriptProperties['id']) !== strlen((integer)$scriptProperties['id'])) {
      Severity: Minor
      Found in manager/controllers/default/security/user/update.class.php - About 55 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