railpage/railpagecore

View on GitHub

Showing 1,011 of 9,214 total issues

Method getReputationTypes has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getReputationTypes() {
        $reps = array(
            1 => array(
                "id" => 1,
                "name" => "Like",
Severity: Minor
Found in lib/Forums/Forums.php - About 1 hr to fix

    Method createNewsArticle_Winner has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function createNewsArticle_Winner(Competition $photoComp) {
            
            /**
             * Get the winning photo
             */
    Severity: Minor
    Found in lib/Images/Utility/CompetitionUtility.php - About 1 hr to fix

      Method getStatusDescription has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getStatusDescription($statusId = null) {
              if (!filter_var($statusId, FILTER_VALIDATE_INT)) {
                  return;
              }
              
      Severity: Minor
      Found in lib/Ideas/Ideas.php - About 1 hr to fix

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

                public function __construct($topic_alias = false) {
                    parent::__construct(); 
                    
                    if (!$topic_alias) {
                        return false;
        Severity: Minor
        Found in lib/News/Topic_From_Alias.php - About 1 hr to fix

          Method findFromTags has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function findFromTags($tags) {
                  if (!is_array($tags)) {
                      $tags = array($tags);
                  }
                  
          Severity: Minor
          Found in lib/Locos/Maintainers/Finder.php - About 1 hr to fix

            Method members has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function members() {
                    $query = "SELECT l.*, s.name AS loco_status, o.operator_name, ow.operator_name AS owner_name, g.*
                                FROM loco_unit AS l 
                                LEFT JOIN loco_status AS s ON l.loco_status_id = s.id 
                                LEFT JOIN operators AS ow ON l.owner_id = ow.operator_id 
            Severity: Minor
            Found in lib/Locos/LocoClass.php - About 1 hr to fix

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

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

                Method topics has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function topics($items_per_page = 25, $page_num = 1, $sort = "DESC") {
                        
                        $query = "SELECT 
                                        SQL_CALC_FOUND_ROWS 
                                        t.*, 
                Severity: Minor
                Found in lib/Forums/Forum.php - About 1 hr to fix

                  Method getLatest has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getLatest($update = true) {
                          
                          if ($footage = $this->getLatestFootage("image")) {
                              
                              return [
                  Severity: Minor
                  Found in lib/Railcams/Camera.php - About 1 hr to fix

                    The class Location has 26 fields. Consider redesigning Location to keep the number of fields under 15.
                    Open

                        class Location extends Locations {
                            
                            /**
                             * Registry cache key
                             * @since Version 3.9.1
                    Severity: Minor
                    Found in lib/Locations/Location.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Message has 23 fields. Consider redesigning Message to keep the number of fields under 15.
                    Open

                    class Message extends PrivateMessages {
                        
                        /** 
                         * Message ID
                         * @since Version 3.3
                    Severity: Minor
                    Found in lib/PrivateMessages/Message.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class User has 94 fields. Consider redesigning User to keep the number of fields under 15.
                    Open

                    class User extends Base {
                    
                        /**
                         * Registry cache key
                         * @since Version 3.9.1
                    Severity: Minor
                    Found in lib/Users/User.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Job has 16 fields. Consider redesigning Job to keep the number of fields under 15.
                    Open

                    class Job extends Jobs {
                        
                        /**
                         * Job ID
                         * @var int $id
                    Severity: Minor
                    Found in lib/Jobs/Job.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Article has 29 fields. Consider redesigning Article to keep the number of fields under 15.
                    Open

                        class Article extends Base {
                            
                            /**
                             * Cache key to store and fetch the formatted lead text from the cache
                             * @since Version 3.10.0
                    Severity: Minor
                    Found in lib/News/Article.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Download has 17 fields. Consider redesigning Download to keep the number of fields under 15.
                    Open

                    class Download extends Base {
                        
                        /**
                         * Download ID
                         * @since Version 3.2
                    Severity: Minor
                    Found in lib/Downloads/Download.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Image has 21 fields. Consider redesigning Image to keep the number of fields under 15.
                    Open

                    class Image extends AppCore {
                    
                        /**
                         * Max age of data before it requires refreshing
                         */
                    Severity: Minor
                    Found in lib/Images/Image.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Locomotive has 32 fields. Consider redesigning Locomotive to keep the number of fields under 15.
                    Open

                    class Locomotive extends Locos {
                        
                        /**
                         * Registry cache key
                         * @since Version 3.9.1
                    Severity: Minor
                    Found in lib/Locos/Locomotive.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Organisation has 16 fields. Consider redesigning Organisation to keep the number of fields under 15.
                    Open

                        class Organisation extends Base {
                            
                            /**
                             * Registry key
                             * @since Version 3.9.1
                    Severity: Minor
                    Found in lib/Organisations/Organisation.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class LocoClass has 26 fields. Consider redesigning LocoClass to keep the number of fields under 15.
                    Open

                    class LocoClass extends Locos {
                        
                        /**
                         * Registry cache key
                         * @since Version 3.9.1
                    Severity: Minor
                    Found in lib/Locos/LocoClass.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    The class Camera has 21 fields. Consider redesigning Camera to keep the number of fields under 15.
                    Open

                    class Camera extends Railcams {
                        
                        /**
                         * Camera ID
                         * @since Version 3.4
                    Severity: Minor
                    Found in lib/Railcams/Camera.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

                    Severity
                    Category
                    Status
                    Source
                    Language