railpage/railpagecore

View on GitHub

Showing 708 of 9,214 total issues

Method formatDepartures has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function formatDepartures($departures) {
        $return = array();
        
        if (isset($departures['values'])) {
            foreach ($departures['values'] as $row) {
Severity: Minor
Found in lib/GTFS/AU/VIC/PTV/Stop.php - About 1 hr to fix

    Method addReputationMarker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function addReputationMarker($reputation_type_id = false) {
            if (!filter_var($reputation_type_id, FILTER_VALIDATE_INT)) {
                throw new Exception("Cannot add a reputation marker to this post because the supplied type ID (\$reputation_type_id) is not valid");
            }
            
    Severity: Minor
    Found in lib/Forums/Post.php - About 1 hr to fix

      Method tryAutoLogin has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      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");
      
      Severity: Minor
      Found in lib/Users/User.php - About 1 hr to fix

        Method randomImage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function randomImage($namespace, $namespaceKey) {
                
                $Database = (new AppCore)->getDatabaseConnection(); 
                
                if (is_null($namespace) && !is_null($namespaceKey)) {
        Severity: Minor
        Found in lib/Images/Utility/Finder.php - About 1 hr to fix

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

              public function __construct($id = null) {
                  parent::__construct(); 
                  
                  if (!filter_var($id, FILTER_VALIDATE_INT)) {
                      return;
          Severity: Minor
          Found in lib/Feedback/FeedbackItem.php - About 1 hr to fix

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

                public function validate() {
                    if (is_null($this->object_id)) {
                        $this->object_id = "";
                    }
                    
            Severity: Minor
            Found in lib/PrivateMessages/Message.php - About 1 hr to fix

              Method newest has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              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";
              Severity: Minor
              Found in lib/SiteMessage/SiteMessage.php - About 1 hr to fix

                Method isDuplicate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public function isDuplicate() {
                
                            $Sphinx = $this->getSphinx();
                
                            /**
                Severity: Minor
                Found in lib/News/Article.php - About 1 hr to fix

                  Method getModuleId has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static function getModuleId($module) {
                          
                          $module_ids = [
                              "assets" => 110,
                              "chronicle" => 118,
                  Severity: Minor
                  Found in lib/Module.php - About 1 hr to fix

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

                        public function getArray() {
                            $array = array(
                                "id" => $this->id,
                                "title" => $this->title,
                                "description" => $this->desc,
                    Severity: Minor
                    Found in lib/Events/Event.php - About 1 hr to fix

                      Method dispatch has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public function dispatch() {
                                  
                                  /**
                                   * Set the dispatch transport
                                   */
                      Severity: Minor
                      Found in lib/Notifications/Notification.php - About 1 hr to fix

                        Method formatText has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function formatText($string, $options) {
                                
                                AppCore::getSmarty()->addStylesheet("/themes/jiffy_simple/style/opt.embedded.css"); 
                                
                                $defaultOptions = [
                        Severity: Minor
                        Found in lib/ContentUtility.php - About 1 hr to fix

                          Method getPath has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getPath() {
                                  $mckey = sprintf("railpage:gtfs.path;provider=%s;route=%s", $this->Provider->getProviderName(), $this->short_name);
                                  
                                  $Memcached = AppCore::GetMemcached(); 
                                  
                          Severity: Minor
                          Found in lib/GTFS/StandardRoute.php - About 1 hr to fix

                            Method storeFile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function storeFile($tmpFile, $origFile) {
                                    
                                    if (!file_exists($tmpFile)) {
                                        throw new InvalidArgumentException("Supplied file path " . $tmpFile . " does not exist"); 
                                    }
                            Severity: Minor
                            Found in lib/Railcams/Storage/LocalFS.php - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              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;
                              Severity: Critical
                              Found in lib/Images/Image.php - About 1 hr to fix

                                Method getPhotosFromSphinx has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getPhotosFromSphinx($num = 10) {
                                        
                                        $Sphinx = AppCore::getSphinxAPI(); 
                                        
                                        $Sphinx->SetGeoAnchor("lat", "lon", deg2rad($this->lat), deg2rad($this->lon)); 
                                Severity: Minor
                                Found in lib/Place.php - About 1 hr to fix

                                  Method memberList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function memberList($page = 1, $items_per_page = 25) {
                                          
                                          $start = $page > 0 ? ($page - 1) * $items_per_page : 0;
                                          $return = array(); 
                                          
                                  Severity: Minor
                                  Found in lib/Users/Admin.php - About 1 hr to fix

                                    Method assemble has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function assemble() {
                                            
                                            Debug::LogCLI("Assembling the collage"); 
                                            
                                            $imageSize = $this->findThumbnailSize(); 
                                    Severity: Minor
                                    Found in lib/Images/Collage.php - About 1 hr to fix

                                      Method addMember has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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); 
                                              
                                      Severity: Minor
                                      Found in lib/Users/Group.php - About 1 hr to fix

                                        Method createNewExif has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function createNewExif($type, $exif) {
                                                
                                                switch ($type) {
                                                    
                                                    case "camera_id" :
                                        Severity: Minor
                                        Found in lib/Images/Exif.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language