railpage/railpagecore

View on GitHub

Showing 708 of 9,214 total issues

Method recent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
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 
Severity: Minor
Found in lib/BanControl/LookupUtility.php - About 1 hr to fix

    Method GuessCoverPhoto has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function GuessCoverPhoto($searchQuery) {
            
            $defaultPhoto = "https://static.railpage.com.au/i/logo-fb.jpg";
            
            $cachekey = sprintf("railpage:coverphoto=%s", md5($searchQuery)); 
    Severity: Minor
    Found in lib/Images/Utility/Finder.php - About 1 hr to fix

      Method getRegions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getRegions($country = NULL) {
              
              $params = []; 
              $where = [];
              
      Severity: Minor
      Found in lib/Images/Utility/Geoplace.php - About 1 hr to fix

        Method getDeleted has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function getDeleted($user_id = false) {
                    if (!$user_id) {
                        throw new Exception("Cannot fetch deleted message IDs - no user ID given"); 
                        return false;
                    }
        Severity: Minor
        Found in lib/PrivateMessages/PrivateMessages.php - About 1 hr to fix

          Method createRichText has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function createRichText() {
          
                  if (!is_array($this->meta) || count($this->meta) === 0) {
                      return;
                  }
          Severity: Minor
          Found in lib/Locos/Date.php - About 1 hr to fix

            Method getSmarty has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getSmarty() {
                    
                    $Registry = Registry::getInstance(); 
                    
                    $Config = self::getConfig(); 
            Severity: Minor
            Found in lib/AppCore.php - About 1 hr to fix

              Method CreateOrganisation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public static function CreateOrganisation($id = false) {
                          
                          $Memcached = AppCore::getMemcached(); 
                          $Redis = AppCore::getRedis(); 
                          $Registry = Registry::getInstance(); 
              Severity: Minor
              Found in lib/Organisations/Factory.php - About 1 hr to fix

                Method addNote has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function addNote($noteText = false, $userId = false, $noteId = false) {
                        if (!$noteText || empty($noteText)) {
                            throw new Exception("No note text given"); 
                        } 
                        
                Severity: Minor
                Found in lib/Locos/Locomotive.php - About 1 hr to fix

                  Method listClasses has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function listClasses($types = null) {
                          $params = array(); 
                          $return = array(); 
                          
                          $suffix = $types === false ? "all" : (is_array($types) ? implode(",", $types) : $types); 
                  Severity: Minor
                  Found in lib/Locos/Locos.php - About 1 hr to fix

                    Method getSubmitData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    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))) ||
                    Severity: Minor
                    Found in lib/Locos/Utility/LocomotiveUtility.php - About 1 hr to fix

                      Method updateFleet_OwnerOperator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function updateFleet_OwnerOperator(LocoClass $Class) {
                              
                              $Database = (new AppCore)->getDatabaseConnection(); 
                              
                              $members = $Class->members(); 
                      Severity: Minor
                      Found in lib/Locos/Utility/LocoClassUtility.php - About 1 hr to fix

                        Method createSlug has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public function createSlug($id = false, $name = false) {
                                    
                                    $timer = Debug::GetTimer(); 
                                    
                                    if (filter_var($id, FILTER_VALIDATE_INT) && !$name) {
                        Severity: Minor
                        Found in lib/Organisations/Base.php - About 1 hr to fix

                          Method formatWoE has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function formatWoE($woe) {
                                  
                                  $thiswoe = $woe['places']['place'][0];
                                  
                                  $data = array(
                          Severity: Minor
                          Found in lib/PlaceUtility.php - About 1 hr to fix

                            Method getArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getArray() {
                                    $return = array(
                                        "id" => $this->id,
                                        "title" => $this->title,
                                        "reference_id" => $this->reference_id,
                            Severity: Minor
                            Found in lib/Jobs/Job.php - About 1 hr to fix

                              Method notifySubmissionsOpen has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function notifySubmissionsOpen() {
                                      
                                      /**
                                       * Return if we're not within the submissions bounds
                                       */
                              Severity: Minor
                              Found in lib/Images/Competition.php - About 1 hr to fix

                                Method findLocoImage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function findLocoImage($locoId = null, $liveryId = null) {
                                        if (is_null($locoId)) {
                                            throw new Exception("Cannot find loco image - no loco ID given");
                                        }
                                        
                                Severity: Minor
                                Found in lib/Images/Images.php - About 1 hr to fix

                                  Method NotifyTied has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function NotifyTied(Competition $photoComp) {
                                          
                                          if (isset($photoComp->meta['notifytied']) && $photoComp->meta['notifytied'] >= strtotime("-1 day")) {
                                              return;
                                          }
                                  Severity: Minor
                                  Found in lib/Images/Utility/CompetitionUtility.php - About 1 hr to fix

                                    Method getMostViewedPhotos has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function getMostViewedPhotos($lookup = self::HITS_WEEKLY, $num = 5) {
                                            
                                            $allowed = [ 
                                                self::HITS_DAILY => "hits_today",
                                                self::HITS_WEEKLY => "hits_weekly",
                                    Severity: Minor
                                    Found in lib/Images/Statistics.php - About 1 hr to fix

                                      Method __construct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function __construct($lat = NULL, $lon = NULL) {
                                              parent::__construct();
                                              
                                              $Config = AppCore::GetConfig(); 
                                              
                                      Severity: Minor
                                      Found in lib/Images/MapImage.php - About 1 hr to fix

                                        Method commit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                public function commit() {
                                                    $this->validate(); 
                                                    
                                                    if (isset($this->mckey)) {
                                                        $this->Memcached->delete($this->mckey);
                                        Severity: Minor
                                        Found in lib/Timetables/Train.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language