Showing 708 of 9,214 total issues
Method recent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function recent($activeOnly = null) {
$Database = (new AppCore)->getDatabaseConnection();
$query = "SELECT b.id, b.user_id, un.username AS username, b.ban_active, b.ban_time, b.ban_expire, b.ban_reason, b.banned_by, u.username AS banned_by_username
Method GuessCoverPhoto
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function GuessCoverPhoto($searchQuery) {
$defaultPhoto = "https://static.railpage.com.au/i/logo-fb.jpg";
$cachekey = sprintf("railpage:coverphoto=%s", md5($searchQuery));
Method getRegions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getRegions($country = NULL) {
$params = [];
$where = [];
Method getDeleted
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getDeleted($user_id = false) {
if (!$user_id) {
throw new Exception("Cannot fetch deleted message IDs - no user ID given");
return false;
}
Method createRichText
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createRichText() {
if (!is_array($this->meta) || count($this->meta) === 0) {
return;
}
Method getSmarty
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getSmarty() {
$Registry = Registry::getInstance();
$Config = self::getConfig();
Method CreateOrganisation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function CreateOrganisation($id = false) {
$Memcached = AppCore::getMemcached();
$Redis = AppCore::getRedis();
$Registry = Registry::getInstance();
Method addNote
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addNote($noteText = false, $userId = false, $noteId = false) {
if (!$noteText || empty($noteText)) {
throw new Exception("No note text given");
}
Method listClasses
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function listClasses($types = null) {
$params = array();
$return = array();
$suffix = $types === false ? "all" : (is_array($types) ? implode(",", $types) : $types);
Method getSubmitData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getSubmitData(Locomotive $Loco) {
// Drop whitespace from loco numbers of all types except steam
if (in_array($Loco->class_id, array(2, 3, 4, 5, 6)) ||
($Loco->Class instanceof LocoClass && in_array($Loco->Class->type_id, array(2, 3, 4, 5, 6))) ||
Method updateFleet_OwnerOperator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function updateFleet_OwnerOperator(LocoClass $Class) {
$Database = (new AppCore)->getDatabaseConnection();
$members = $Class->members();
Method createSlug
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createSlug($id = false, $name = false) {
$timer = Debug::GetTimer();
if (filter_var($id, FILTER_VALIDATE_INT) && !$name) {
Method formatWoE
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function formatWoE($woe) {
$thiswoe = $woe['places']['place'][0];
$data = array(
Method getArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getArray() {
$return = array(
"id" => $this->id,
"title" => $this->title,
"reference_id" => $this->reference_id,
Method notifySubmissionsOpen
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function notifySubmissionsOpen() {
/**
* Return if we're not within the submissions bounds
*/
Method findLocoImage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function findLocoImage($locoId = null, $liveryId = null) {
if (is_null($locoId)) {
throw new Exception("Cannot find loco image - no loco ID given");
}
Method NotifyTied
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function NotifyTied(Competition $photoComp) {
if (isset($photoComp->meta['notifytied']) && $photoComp->meta['notifytied'] >= strtotime("-1 day")) {
return;
}
Method getMostViewedPhotos
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getMostViewedPhotos($lookup = self::HITS_WEEKLY, $num = 5) {
$allowed = [
self::HITS_DAILY => "hits_today",
self::HITS_WEEKLY => "hits_weekly",
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($lat = NULL, $lon = NULL) {
parent::__construct();
$Config = AppCore::GetConfig();
Method commit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function commit() {
$this->validate();
if (isset($this->mckey)) {
$this->Memcached->delete($this->mckey);