e107inc/e107

View on GitHub
e107_handlers/language_class.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
15%

Consider simplifying this complex logical expression.
Open

        if(defined('e_PAGE_LANGUAGE') && ($detect_language = $this->isValid(e_PAGE_LANGUAGE))) // page specific override.
        {
            $doNothing = '';
            // Do nothing as $detect_language is set.
        }
Severity: Critical
Found in e107_handlers/language_class.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

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

      Returning type object|string but isValid() is declared to return false
      Open

                  return $lang;    
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Reference to undeclared constant \e_PAGE_LANGUAGE
      Open

              if(defined('e_PAGE_LANGUAGE') && ($detect_language = $this->isValid(e_PAGE_LANGUAGE))) // page specific override.
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Reference to undeclared property \language->_select_array
      Open

              return $this->_select_array;
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Argument 2 (value) is false but \setcookie() takes string
      Open

                      setcookie('e107_language', $this->detect, time() + 86400, e_HTTP);
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Reference to undeclared property \language->_select_array
      Open

                  $this->_select_array = array();
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Default value for object $lang can't be string
      Open

          function isValid($lang='')
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Argument 1 (lang) is false but \language::isValid() takes object|string defined at /code/e107_handlers/language_class.php:278
      Open

                  if(!$session->has('e_language') || (($session->get('e_language') != $this->detect) && $this->isValid($this->detect)))
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Reference to undeclared property \language->_select_array
      Open

                      $this->_select_array[$this->convert($lan)] = $this->toNative($lan);
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Parameter $type has undeclared type \str
      Open

          function installed($type='english')
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Reference to undeclared property \language->_select_array
      Open

              if($force ||null === $this->_select_array)
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

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

                  return (isset($this->list[$data])) ? $this->list[$data] : false;
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Default value for \str $type can't be string
      Open

          function installed($type='english')
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      Returning type int but installed() is declared to return array
      Open

                      return count($this->lanlist);
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

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

                  return isset($tmp[$data]) ? $tmp[$data] : false;
      Severity: Minor
      Found in e107_handlers/language_class.php by phan

      There are no issues that match your filters.

      Category
      Status