railpage/railpagecore

View on GitHub

Showing 708 of 9,214 total issues

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

    public function getArray() {
        $idea = array(
            "id" => $this->id,
            "title" => $this->title,
            "description" => function_exists("format_post") ? format_post($this->description) : $this->description,
Severity: Minor
Found in lib/Ideas/Idea.php - About 1 hr to fix

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

            public function __construct($id = false) {
                parent::__construct(); 
                
                if (is_string($id)) {
                    $query = "SELECT id FROM timetable_points WHERE name = ? OR slug = ?"; 
    Severity: Minor
    Found in lib/Timetables/Point.php - About 1 hr to fix

      Method embedRailpageDownload has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function embedRailpageDownload($e) {
              
              if (pq($e)->attr("href") != pq($e)->text()) {
                  return $e;
              }
      Severity: Minor
      Found in lib/Formatting/MultimediaUtility.php - About 1 hr to fix

        Method preProcessBBCodeUIDs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function preProcessBBCodeUIDs($string) {
                
                $format_search    = array(
                    '#\[url=(.*?)\](.*?)\[/url\] by \[url=(.*?)\](.*?)\[/url\], on Flickr#i',
                    "@\[b:([a-zA-Z0-9]+)]@i", 
        Severity: Minor
        Found in lib/Formatting/BbcodeUtility.php - About 1 hr to fix

          Method approve has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function approve($user_id) {
                      if (!$this->id || !$this->db) {
                          return false;
                      }
          
          Severity: Minor
          Found in lib/News/Article.php - About 1 hr to fix

            Method closeCorrection has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function closeCorrection($type, $reason) {
                    
                    if (!isset($this->Resolution->User) || !$this->Resolution->User instanceof User) {
                        throw new Exception("Cannot close correction - User resolving this correction not specified");
                    }
            Severity: Minor
            Found in lib/Locos/Correction.php - About 1 hr to fix

              Method convertCurrency has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function convertCurrency($amount, $dateObject = null) {
                      
                      if (!$dateObject instanceof DateTime) {
                          return;
                      }
              Severity: Minor
              Found in lib/ContentUtility.php - About 1 hr to fix

                Method updateFeaturedImage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function updateFeaturedImage() {
                        
                        $data = array(
                            "featured_photo" => $this->featured_photo_id
                        );
                Severity: Minor
                Found in lib/Gallery/Album.php - About 1 hr to fix

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

                      public function commit() {
                          
                          $this->validate(); 
                          
                          $data = array(
                  Severity: Minor
                  Found in lib/Railcams/Camera.php - About 1 hr to fix

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

                        public function __construct($routeId = null, $gtfsProvider = null) {
                            
                            if (function_exists("getRailpageConfig")) {
                                $this->Config = getRailpageConfig();
                            }
                    Severity: Minor
                    Found in lib/GTFS/StandardRoute.php - About 1 hr to fix

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

                          public function canUserVote(User $userObject, $imageObject = null) {
                              if (!filter_var($userObject->id, FILTER_VALIDATE_INT)) {
                                  return false;
                              }
                              
                      Severity: Minor
                      Found in lib/Images/Competition.php - About 1 hr to fix

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

                            public function setAutoLogin($cookieExpire) {
                        
                                if (empty( $cookieExpire )) {
                                    $cookieExpire = RP_AUTOLOGIN_EXPIRE;
                                }
                        Severity: Minor
                        Found in lib/Users/User.php - About 1 hr to fix

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

                              private function findThumbnailSize() {
                                  
                                  Debug::LogCLI("Finding the minimum image size required to cover the canvas"); 
                                  
                                  $Image = array_slice($this->Images, 0, 1); 
                          Severity: Minor
                          Found in lib/Images/Collage.php - About 1 hr to fix

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

                                public function newAPIKey() {
                            
                                    $len = 32;
                            
                                    if (@is_readable('/dev/urandom')) {
                            Severity: Minor
                            Found in lib/Users/User.php - About 1 hr to fix

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

                                  public function updateHash() {
                              
                                      $cookie = is_null(filter_input(INPUT_COOKIE, "rp_userhash")) ? "" : filter_input(INPUT_COOKIE, "rp_userhash"); # isset($_COOKIE['rp_userhash']) ? $_COOKIE['rp_userhash'] : "";
                                      $hash = array();
                                      $update = false;
                              Severity: Minor
                              Found in lib/Users/User.php - About 1 hr to fix

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

                                        public function find($keys = false, $value = false, $limit = 25) {
                                            
                                            $timer = Debug::getTimer(); 
                                            
                                            if (!$keys) {
                                Severity: Minor
                                Found in lib/SiteEvent/Base.php - About 1 hr to fix

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

                                      public function unBanIp($banId, $ipAddress = null) {
                                          
                                          /**
                                           * Empty the cache
                                           */
                                  Severity: Minor
                                  Found in lib/BanControl/BanControl.php - About 1 hr to fix

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

                                        public function getStylesheets() {
                                            $tags = array(); 
                                            
                                            $minify = array(); 
                                            
                                    Severity: Minor
                                    Found in lib/Template.php - About 1 hr to fix

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

                                              private function load($country, $region) {
                                      
                                                  if (filter_var($country, FILTER_VALIDATE_INT)) {
                                                      // We're looking up a WoE ID
                                                      $woe = $this->fetchWoE($country, $region);
                                      Severity: Minor
                                      Found in lib/Locations/Region.php - About 1 hr to fix

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

                                                public static function CreateArticle($id) {
                                                    
                                                    $Redis = AppCore::getRedis();
                                                    $Memcached = AppCore::getMemcached(); 
                                                    $Registry = Registry::getInstance();  
                                        Severity: Minor
                                        Found in lib/News/Factory.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language