Showing 1,011 of 9,214 total issues
Method tryAutoLogin
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function tryAutoLogin() {
if (is_null(filter_input(INPUT_COOKIE, "rp_autologin"))) { #empty($_COOKIE['rp_autologin'])) {
$this->addNote("Autologin attempted but no autologin cookie was found");
Method randomImage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function randomImage($namespace, $namespaceKey) {
$Database = (new AppCore)->getDatabaseConnection();
if (is_null($namespace) && !is_null($namespaceKey)) {
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($id = null) {
parent::__construct();
if (!filter_var($id, FILTER_VALIDATE_INT)) {
return;
Method validate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validate() {
if (is_null($this->object_id)) {
$this->object_id = "";
}
Method newest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function newest($user_id = false, $fullArray = false) {
if ($this->db instanceof \sql_db) {
if ($user_id) {
// Logged in, have they dismissed this message?
$query = "SELECT * FROM messages WHERE message_active = 1 AND message_id NOT IN (SELECT message_id FROM messages_viewed WHERE user_id = ".$this->db->real_escape_string($user_id).") ORDER BY message_id DESC LIMIT 1";
Method isDuplicate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function isDuplicate() {
$Sphinx = $this->getSphinx();
/**
Method getModuleId
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function getModuleId($module) {
$module_ids = [
"assets" => 110,
"chronicle" => 118,
Method getArray
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getArray() {
$array = array(
"id" => $this->id,
"title" => $this->title,
"description" => $this->desc,
Method dispatch
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function dispatch() {
/**
* Set the dispatch transport
*/
Method formatText
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function formatText($string, $options) {
AppCore::getSmarty()->addStylesheet("/themes/jiffy_simple/style/opt.embedded.css");
$defaultOptions = [
Method getPath
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPath() {
$mckey = sprintf("railpage:gtfs.path;provider=%s;route=%s", $this->Provider->getProviderName(), $this->short_name);
$Memcached = AppCore::GetMemcached();
Method storeFile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function storeFile($tmpFile, $origFile) {
if (!file_exists($tmpFile)) {
throw new InvalidArgumentException("Supplied file path " . $tmpFile . " does not exist");
}
Consider simplifying this complex logical expression. Open
Open
if (( ( !isset( $row['title'] ) || empty( $row['title'] ) || is_null($row['title']) ) && !empty( $this->title ) ) ||
( ( !isset( $row['description'] ) || empty( $row['description'] ) || is_null($row['description']) ) && !empty( $this->description ) )
) {
$row['title'] = $this->title;
$row['description'] = $this->description;
Method getPhotosFromSphinx
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPhotosFromSphinx($num = 10) {
$Sphinx = AppCore::getSphinxAPI();
$Sphinx->SetGeoAnchor("lat", "lon", deg2rad($this->lat), deg2rad($this->lon));
Method memberList
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function memberList($page = 1, $items_per_page = 25) {
$start = $page > 0 ? ($page - 1) * $items_per_page : 0;
$return = array();
Method assemble
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function assemble() {
Debug::LogCLI("Assembling the collage");
$imageSize = $this->findThumbnailSize();
Method addMember
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addMember($username = null, $userId = null, $orgRole = null, $orgContact = null, $orgPerms = null) {
$mckey = sprintf("railpage:group=%d", intval($this->id));
$this->Redis->delete($mckey);
Method createNewExif
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createNewExif($type, $exif) {
switch ($type) {
case "camera_id" :
Method getUnreviewedImages
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getUnreviewedImages($page = 1, $itemsPerPage = 25) {
if (!$this->User instanceof User) {
throw new Exception("Cannot find unreviewed images - no user has been set");
}
Method loadFromCache
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function loadFromCache() {
$mckey = sprintf("railpage:locations.country=%s", strtoupper($this->code));
#printArray($mckey);die;