railpage/railpagecore

View on GitHub

Showing 1,011 of 9,214 total issues

Method resolveTemplate has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function resolveTemplate($template) {
        
        if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
            return $template;
        }
Severity: Minor
Found in lib/Template.php - About 1 hr to fix

    Method getJSON has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getJSON() {
    
            if (isset( $this->author )) {
                $author = clone $this->author;
    
    Severity: Minor
    Found in lib/Images/Image.php - About 1 hr to fix

      Method posts has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function posts($itemsPerPage = 25, $pageNum = 1, $sort = "ASC", $highlights = null) {
              
              $highlight_sql = "";
              
              if (!is_null($highlights)) {
      Severity: Minor
      Found in lib/Forums/Thread.php - About 1 hr to fix

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

            public function __construct($id = NULL) {
                parent::__construct(); 
                
                $this->Module = new Module("events");
                $this->namespace = $this->Module->namespace;
        Severity: Minor
        Found in lib/Events/EventDate.php - About 1 hr to fix

          Method hybi10Encode has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function hybi10Encode($payload, $type = 'text', $masked = true)
              {
                  $frameHead = array();
                  $payloadLength = strlen($payload);
                  switch ($type) {
          Severity: Minor
          Found in lib/SocketIO.php - About 1 hr to fix

            Method getAlerts has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getAlerts(\Zend_Acl $acl) {
            
                    $query = array();
                    $params = array();
            
            Severity: Minor
            Found in lib/Users/User.php - About 1 hr to fix

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

                  public function createSlug($categoryId = false) {
                      if (RP_DEBUG) {
                          global $site_debug;
                          $debug_timer_start = microtime(true);
                      }
              Severity: Minor
              Found in lib/Links/Links.php - About 1 hr to fix

                Method getColumnMapping has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getColumnMapping() {
                        
                        $fields = array(
                            
                            // General
                Severity: Minor
                Found in lib/Users/Utility/UserUtility.php - About 1 hr to fix

                  Method getAssignedItems has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getAssignedItems() {
                          if (!$this->Staff instanceof User) {
                              throw new Exception("You must assign a valid User object before fetching assigned feedback items");
                          }
                          
                  Severity: Minor
                  Found in lib/Feedback/Feedback.php - About 1 hr to fix

                    Method makeQuery has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static function makeQuery() {
                            
                            $basequery = "SELECT SQL_CALC_FOUND_ROWS image.*, g.country_code, g.country_name, g.region_code, 
                                    g.region_name, g.neighbourhood, g.timezone, X(g.point) AS geoplace_lat, Y(g.point) AS geoplace_lon
                                FROM image
                    Severity: Minor
                    Found in lib/Images/Utility/Finder.php - About 1 hr to fix

                      Method fetch has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function fetch() {
                              if (empty($this->id)) {
                                  throw new Exception("Cannot fetch download object - no download ID given"); 
                              }
                              
                      Severity: Minor
                      Found in lib/Downloads/Download.php - About 1 hr to fix

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

                                private function load() {
                                    
                                    $this->mckey = sprintf("railpage:locations.location=%d", $this->id); 
                                    
                                    if (!$row = $this->Memcached->fetch($this->mckey)) {
                        Severity: Minor
                        Found in lib/Locations/Location.php - About 1 hr to fix

                          Method getSiteFromCoords has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
                                      if (!$lat || !$lon || !$this->db) {
                                          return false;
                                      }
                                      
                          Severity: Minor
                          Found in lib/Locations/Locations.php - About 1 hr to fix

                            Function getWinningPhoto has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getWinningPhoto() {
                                    
                                    if ($this->VotingDateClose >= new DateTime) {
                                        return false;
                                    }
                            Severity: Minor
                            Found in lib/Images/Competition.php - About 1 hr to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function setUserFavourite has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function setUserFavourite() {
                                    
                                    /**
                                     * Because I'll no doubt get confused - frequently - at the order of parameters, 
                                     * let's just be a sneaky bastard and check each parameter
                            Severity: Minor
                            Found in lib/Images/Favourites.php - About 1 hr to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function __construct has a Cognitive Complexity of 15 (exceeds 5 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

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function __construct has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function __construct($id = NULL) {
                                    parent::__construct(); 
                                    
                                    $this->Module = new Module("events");
                                    $this->namespace = $this->Module->namespace;
                            Severity: Minor
                            Found in lib/Events/EventDate.php - About 1 hr to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function formatWoE has a Cognitive Complexity of 15 (exceeds 5 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

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method filter has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function filter($args) {
                            
                                    if ($args === false) {
                                        $args = array();
                                    }
                            Severity: Minor
                            Found in lib/Jobs/Jobs.php - About 1 hr to fix

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

                                  public function __construct($module) {
                              
                                      parent::__construct();
                              
                                      if (!is_string($module)) {
                              Severity: Minor
                              Found in lib/Module.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language