e107inc/e107

View on GitHub
e107_handlers/admin_log_class.php

Summary

Maintainability
A
1 hr
Test Coverage
F
53%

Method addEvent has 8 arguments (exceeds 7 allowed). Consider refactoring.
Open

    public function addEvent($importance, $source_call, $eventcode = 'GEN', $event_title = 'Untitled', $explain = '', $finished = FALSE, $target_logs = LOG_TO_AUDIT, $userData=null )
Severity: Major
Found in e107_handlers/admin_log_class.php - About 35 mins to fix

    Method e_log_event has 8 arguments (exceeds 7 allowed). Consider refactoring.
    Open

        public function e_log_event($importance, $source_call, $eventcode = 'GEN', $event_title = 'Untitled', $explain = '', $finished = FALSE, $target_logs = LOG_TO_AUDIT, $userData=null )
    Severity: Major
    Found in e107_handlers/admin_log_class.php - About 35 mins to fix

      Saw possibly unextractable annotation for a fragment of comment '* @param int LOG_TO_ADMIN|LOG_TO_ROLLING|LOG_TO_AUDIT': after int, did not see an element name (will guess based on comment order)
      Open

           * @param int LOG_TO_ADMIN|LOG_TO_ROLLING|LOG_TO_AUDIT
      Severity: Info
      Found in e107_handlers/admin_log_class.php by phan

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

              return $this->logMessage($text, ($message ? E_MESSAGE_WARNING : LOG_MESSAGE_NODISPLAY), E_MESSAGE_WARNING, $session);
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      Default value for int $type can't be string
      Open

          public function logMessage($text, $type = '', $logLevel = TRUE, $session = FALSE)
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

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

              return $this->logMessage($text, $type, $type, $session);    
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      Saw possibly unextractable annotation for a fragment of comment '* @param boolean true = append to file, false = new file each save.': after boolean, did not see an element name (will guess based on comment order)
      Open

           * @param boolean true = append to file, false = new file each save. 
      Severity: Info
      Found in e107_handlers/admin_log_class.php by phan

      Default value for string $mstack can't be false
      Open

          public function save($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false, $target = LOG_TO_ADMIN)
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      Call to undeclared method \e_db::escape
      Open

              $explain = e107::getDb()->escape($tp->toDB($explain, true, false, 'no_html'));
      Severity: Critical
      Found in e107_handlers/admin_log_class.php by phan

      Saw possibly unextractable annotation for a fragment of comment '* @param string name without the extension. (ie. date prefix and .log suffix will be added automatically)': after string, did not see an element name (will guess based on comment order)
      Open

           * @param string name without the extension. (ie. date prefix and .log suffix will be added automatically)
      Severity: Info
      Found in e107_handlers/admin_log_class.php by phan

      Saw possibly unextractable annotation for a fragment of comment '* @param string Title for use inside the Log file': after string, did not see an element name (will guess based on comment order)
      Open

           * @param string Title for use inside the Log file
      Severity: Info
      Found in e107_handlers/admin_log_class.php by phan

      Argument 5 (explain) is array<int>|array{0:string}</int> but \e_admin_log::addEvent() takes string defined at /code/e107_handlers/admin_log_class.php:237
      Open

                  $this->addEvent(4, $debug[1]['file']. '|' .$debug[1]['function']. '@' .$debug[1]['line'], 'USERAUDIT', $title, $debug, FALSE);
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      Assigning null to property but \e_admin_log->logFile is string
      Open

              $this->logFile = null;
      Severity: Minor
      Found in e107_handlers/admin_log_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

              return $this->logMessage($text, ($message ? E_MESSAGE_SUCCESS : LOG_MESSAGE_NODISPLAY), E_MESSAGE_SUCCESS, $session);
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

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

              return $this->logMessage($text, ($message ? E_MESSAGE_ERROR : LOG_MESSAGE_NODISPLAY), E_MESSAGE_ERROR, $session);
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      Default value for string $mstack can't be false
      Open

          public function flushMessages($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false, $target =LOG_TO_ADMIN)
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      Returning type \e_admin_log but logArrayAll() is declared to return null
      Open

                  return $this->add($event, $target, E_LOG_INFORMATIVE, '');    // supports arrays
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

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

              return $this->logMessage($text, ($message ? E_MESSAGE_DEBUG : LOG_MESSAGE_NODISPLAY), E_MESSAGE_DEBUG, $session);
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      array to string conversion
      Open

                  $event_detail .= "\n\n".debug_backtrace(false);
      Severity: Info
      Found in e107_handlers/admin_log_class.php by phan

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

                      $this->logMessage($changes, LOG_MESSAGE_NODISPLAY, E_MESSAGE_INFO);
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      Call to deprecated function \getperms() defined at /code/class2.php:1322
      Open

              if(E107_DEBUG_LEVEL > 0 && getperms('0'))
      Severity: Minor
      Found in e107_handlers/admin_log_class.php by phan

      There are no issues that match your filters.

      Category
      Status