e107inc/e107

View on GitHub
e107_handlers/pref_class.php

Summary

Maintainability
A
3 hrs
Test Coverage
D
60%

Avoid deeply nested control flow statements.
Open

                        if(!$disallow_logs) $log->logMessage('Backup of <strong>'.$this->alias.' ('.$this->prefid.')</strong> successfully created.', E_MESSAGE_DEBUG, E_MESSAGE_SUCCESS, $session_messages);
Severity: Major
Found in e107_handlers/pref_class.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if(deftrue('e_DEBUG_PREFS'))
                            {
                                $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2);
                                $log->logMessage(print_a($backtrace,true),  E_MESSAGE_DEBUG);
                            }
    Severity: Major
    Found in e107_handlers/pref_class.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if(deftrue('e_DEBUG_PREFS'))
                              {
                                  $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2);
                                  $log->logMessage(print_a($backtrace,true),  E_MESSAGE_DEBUG);
                              }
      Severity: Major
      Found in e107_handlers/pref_class.php - About 45 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

                      return 0;
          Severity: Major
          Found in e107_handlers/pref_class.php - About 30 mins to fix

            Returning type false but get() is declared to return string
            Open

                        return false;
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            Saw possibly unextractable annotation for a fragment of comment '* @param string val -- pre-serialized string': after string, did not see an element name (will guess based on comment order)
            Open

                * @param  string val -- pre-serialized string
            Severity: Info
            Found in e107_handlers/pref_class.php by phan

            Argument 2 (oldArray) is array but \e_admin_log::addArray() takes null defined at /code/e107_handlers/admin_log_class.php:790
            Open

                                    $log->addArray($new,$old);
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            $$name[] expression may not be PHP 7 compatible
            Open

                            $$name[$key] = $tp->toDB($prefvalue);
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            Argument 2 (MaximumAge) is 1440 but \ecache::retrieve_sys() takes bool|false defined at /code/e107_handlers/cache_handler.php:213
            Open

                        $this->pref_cache = e107::getCache()->retrieve_sys('Config_'.$this->alias, 24 * 60, true);
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            Argument 3 (logLevel) is 'success' but \e_admin_log::logMessage() takes bool|int|true defined at /code/e107_handlers/admin_log_class.php:670
            Open

                                    if(!$disallow_logs) $log->logMessage('Backup of <strong>'.$this->alias.' ('.$this->prefid.')</strong> successfully created.', E_MESSAGE_DEBUG, E_MESSAGE_SUCCESS, $session_messages);
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            Returning type false but getConfigId() is declared to return string
            Open

                    return false;
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            Argument 1 (options) is null but \debug_backtrace() takes bool|int
            Open

                                $log->addWarning(print_r(debug_backtrace(null,2), true), false);
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            Returning type false but get() is declared to return string
            Open

                            return false;
            Severity: Minor
            Found in e107_handlers/pref_class.php by phan

            There are no issues that match your filters.

            Category
            Status