MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Function writeFile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function writeFile($_filepath, $_contents, Smarty $smarty)
    {
        $_error_reporting = error_reporting();
        error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING);
        if ($smarty->_file_perms !== null) {
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_write_file.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

Function yy_r10 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function yy_r10(){
    if ($this->php_handling == Smarty::PHP_PASSTHRU) {
        $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
    } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
        $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES));
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_templateparser.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

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

    public function __construct($main, $slave = false, $strict = false)
    {
        if ($strict) {
            $this->mysqliW = new mysqli_strict($main['host'],
                $main['user'], $main['pass'],
Severity: Minor
Found in include/classes/mysqlims.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

Function initResetPassword has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  public function initResetPassword($username) {
    $this->debug->append("STA " . __METHOD__, 4);
    // Fetch the users mail address
    if (empty($username)) {
      $this->setErrorMessage("Username must not be empty");
Severity: Minor
Found in include/classes/user.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

Function compile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function compile($args, $compiler, $parameter)
    {
        static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);
        // check and get attributes
        $_attr = $this->getAttributes($compiler, $args);
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_compile_continue.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

Function sendInvitation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  public function sendInvitation($account_id, $aData) {
    $this->debug->append("STA " . __METHOD__, 4);
    // Check data input
    if (empty($aData['email']) || !filter_var($aData['email'], FILTER_VALIDATE_EMAIL)) {
      $this->setErrorMessage($this->getErrorMsg('E0023'));
Severity: Minor
Found in include/classes/invitation.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

Function checkAccess has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  function checkAccess($user_id, $get_id=NULL) {
    if (!empty($get_id) && is_array($get_id)) die("Access denied");
    if (is_array($user_id)) die("Access denied");
    if ( ! $this->user->isAdmin($user_id) && (!empty($get_id) && $get_id != $user_id || !is_int($user_id))) {
      // User is NOT admin and tries to access an ID that is not their own
Severity: Minor
Found in include/classes/api.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

Function importByteStream has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function importByteStream(Swift_OutputByteStream $os)
    {
        if (!isset($this->_charReader)) {
            $this->_charReader = $this->_charReaderFactory
                ->getReaderFor($this->_charset);

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 afterEhlo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function afterEhlo(Swift_Transport_SmtpAgent $agent)
    {
        if ($this->_username) {
            $count = 0;
            foreach ($this->_getAuthenticatorsForAgent() as $authenticator) {

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 send has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function send(Swift_Mime_Message $message, &$failedRecipients = null)
    {
        $sent = 0;
        $failedRecipients = (array) $failedRecipients;

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 send has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function send(Swift_Mime_Message $message, &$failedRecipients = null)
    {
        $maxTransports = count($this->_transports);
        $sent = 0;

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 start has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function start()
    {
        if (!$this->_started) {
            if ($evt = $this->_eventDispatcher->createTransportChangeEvent($this)) {
                $this->_eventDispatcher->dispatchEvent($evt, 'beforeTransportStarted');

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 _show has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        value: function _show(element) {
          if (this._transitioning || $(element).hasClass(this._config.collapsingClass)) {
            return;
          }
          var _this = this;

    Method trigger_template_error has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function trigger_template_error($args = null, $line = null)
        {
            // get template source line which has error
            if (!isset($line)) {
                $line = $this->lex->line;

      Method yy_find_shift_action has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

         public function yy_find_shift_action($iLookAhead)
          {
              $stateno = $this->yystack[$this->yyidx]->stateno;
      
              /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_templateparser.php - About 1 hr to fix

        Method yy_find_shift_action has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

           public function yy_find_shift_action($iLookAhead)
            {
                $stateno = $this->yystack[$this->yyidx]->stateno;
        
                /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 1 hr to fix

          Method checkPin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public function checkPin($userId, $pin='') {
              $this->debug->append("STA " . __METHOD__, 4);
              $this->debug->append("Confirming PIN for $userId and pin $pin", 2);
              $strPinHash = $this->getUserPinHashById($userId);
              $aPin = explode('$', $strPinHash);
          Severity: Minor
          Found in include/classes/user.class.php - About 1 hr to fix

            Method storeUptimeRobotStatus has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public function storeUptimeRobotStatus() {
                if ($api_keys = $this->setting->getValue('monitoring_uptimerobot_api_keys')) {
                  $aJSONData = array();
                  $url = 'https://api.uptimerobot.com';
                  $aMonitors = explode(',', $api_keys);
            Severity: Minor
            Found in include/classes/monitoring.class.php - About 1 hr to fix

              Method _doAnchors_reference_callback has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _doAnchors_reference_callback($matches) {
                      $whole_match =  $matches[1];
                      $link_text   =  $matches[2];
                      $link_id     =& $matches[3];
              
              
              Severity: Minor
              Found in include/lib/Michelf/Markdown.php - About 1 hr to fix

                Method stripLinkDefinitions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function stripLinkDefinitions($text) {
                    #
                    # Strips link definitions from text, stores the URLs and titles in
                    # hash references.
                    #
                Severity: Minor
                Found in include/lib/Michelf/Markdown.php - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language