railpage/railpagecore

View on GitHub

Showing 708 of 9,214 total issues

Method getConfig has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

        public function commit() {
            $this->validate(); 
            
            $data = array(
                "event_id" => $this->Event->id,
    Severity: Minor
    Found in lib/Events/EventDate.php - About 1 hr to fix

      Method populate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function populate() {
      
              $this->mckey = sprintf("railpage.locos.date=%d", $this->id);
              $update = false;
      
      Severity: Minor
      Found in lib/Locos/Date.php - About 1 hr to fix

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

            public function commit($force = false) {
        
                $this->validate($force);
        
                Utility\UserUtility::clearCache($this);
        Severity: Minor
        Found in lib/Users/User.php - About 1 hr to fix

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

              public function commit() {
          
                  $this->validate();
          
                  $this->hash = md5($this->meta['url']);
          Severity: Minor
          Found in lib/Assets/Asset.php - About 1 hr to fix

            Method getHeadTags has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getHeadTags() {
                    $tags = array(); 
                    
                    if (count($this->rp_meta_tags)) {
                        
            Severity: Minor
            Found in lib/Template.php - About 1 hr to fix

              Method reviewImage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function reviewImage(Image $imageObject, User $userObject, $publish = 0, $pick = 0) {
                      
                      $publish = (bool) intval($publish);
                      $pick = (bool) intval($pick); 
                      
              Severity: Minor
              Found in lib/Images/Screener.php - About 1 hr to fix

                Method nearby has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public function nearby($lat = false, $lon = false, $radius = false) {
                            
                            if (!$lat) {
                                throw new Exception("Cannot fetch locations near co-ordinates: no latitude value given");
                            }
                Severity: Minor
                Found in lib/Locations/Locations.php - About 1 hr to fix

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

                      public function commit() {
                          $this->validate(); 
                          
                          $data = array(
                              "type" => $this->Type->id,
                  Severity: Minor
                  Found in lib/Glossary/Entry.php - About 1 hr to fix

                    Method getLogger has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method InsertOriginalSize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function InsertOriginalSize() {
                              
                              $Database = (new AppCore)->getDatabaseConnection(); 
                              
                              $query = "SELECT id, path FROM gallery_mig_image WHERE hidden = 0 AND id NOT IN (SELECT photo_id FROM gallery_mig_image_sizes WHERE size = 'original')";
                      Severity: Minor
                      Found in lib/Gallery/Utility/CreateSizes.php - About 1 hr to fix

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

                            public function __construct($id = NULL) {
                        
                                $timer = Debug::getTimer();
                        
                                parent::__construct();
                        Severity: Minor
                        Found in lib/Locos/Manufacturer.php - About 1 hr to fix

                          Method populate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  private function populate() {
                                      
                                      $timer = Debug::getTimer(); 
                                      
                                      $this->mckey = sprintf("railpage:organisations.organisation=%d", $this->id); 
                          Severity: Minor
                          Found in lib/Organisations/Organisation.php - About 1 hr to fix

                            Method findGeoPlaceID has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function findGeoPlaceID($lat, $lon) {
                                    
                                    if (!filter_var($lat, FILTER_VALIDATE_FLOAT) || !filter_var($lon, FILTER_VALIDATE_FLOAT)) {
                                        throw new InvalidArgumentException("Invalid geographic co-ordinates");
                                    }
                            Severity: Minor
                            Found in lib/PlaceUtility.php - About 1 hr to fix

                              Method getVideos has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getVideos($num = 25) {
                                      if (!$this->video_store_url) {
                                          return false;
                                      }
                                      
                              Severity: Minor
                              Found in lib/Railcams/Camera.php - About 1 hr to fix

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

                                    public function commit() {
                                        
                                        $this->validate(); 
                                        
                                        /**
                                Severity: Minor
                                Found in lib/Chronicle/Entry.php - About 1 hr to fix

                                  Method getPreferences has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function getPreferences($section = false) {
                                  
                                          $prefs = is_object($this->preferences) ? json_decode(json_encode($this->preferences), true) : $this->preferences;
                                  
                                          if (is_string($prefs)) {
                                  Severity: Minor
                                  Found in lib/Users/User.php - About 1 hr to fix

                                    Method purge has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function purge() {
                                            // Purge pending accounts older than 24 hours
                                            $age = strtotime("-2 weeks"); 
                                            
                                            $query = "SELECT u.username, u.user_id, u.user_regdate, u.user_actkey 
                                    Severity: Minor
                                    Found in lib/Users/Base.php - About 1 hr to fix

                                      Method validate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function validate() {
                                              if (empty($this->name)) {
                                                  throw new Exception("Verification failed - download must have a name");
                                              }
                                              
                                      Severity: Minor
                                      Found in lib/Downloads/Download.php - About 1 hr to fix

                                        Method processExif has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private static function processExif($row) {
                                                
                                                $key = $row['label'];
                                                
                                                $column_lookup = [
                                        Severity: Minor
                                        Found in lib/Images/Provider/Flickr.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language