railpage/railpagecore

View on GitHub

Showing 1,011 of 9,214 total issues

The method getRegions() has 138 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

        public function getRegions($country = false) {
            $query = "SELECT COUNT(l.id) AS count, l.region_slug AS slug,
                g.region_name AS name, g.region_code, g.timezone
                FROM location AS l 
                    LEFT JOIN geoplace AS g ON l.geoplace = g.id 
Severity: Minor
Found in lib/Locations/Country.php by phpmd

The method banUser() has an NPath complexity of 640. The configured NPath complexity threshold is 200.
Open

    public function banUser($userId = null, $reason = null, $expiry = "0", $adminUserId = null) {
        
        if (!filter_var($userId, FILTER_VALIDATE_INT)) {
            throw new InvalidArgumentException("No user ID supplied"); 
        }
Severity: Minor
Found in lib/BanControl/BanControl.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method getPhotoContext() has 115 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public static function getPhotoContext(Image $imageObject, $unapprovedOnly = null) {
        
        $Database = (new AppCore)->getDatabaseConnection(); 
        
        if ($unapprovedOnly == false || $unapprovedOnly == null) {
Severity: Minor
Found in lib/Images/Utility/Finder.php by phpmd

The method validate() has an NPath complexity of 512. The configured NPath complexity threshold is 200.
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 by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method suggestLocos() has 146 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public static function suggestLocos(Image $imageObject, $skipTagged = null) {
        
        $locolookup = array();
        $locos = array();
Severity: Minor
Found in lib/Images/Utility/Tagger.php by phpmd

The method banUser() has 103 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function banUser($userId = null, $reason = null, $expiry = "0", $adminUserId = null) {
        
        if (!filter_var($userId, FILTER_VALIDATE_INT)) {
            throw new InvalidArgumentException("No user ID supplied"); 
        }
Severity: Minor
Found in lib/BanControl/BanControl.php by phpmd

The method isClientBanned() has an NPath complexity of 18432. The configured NPath complexity threshold is 200.
Open

    public static function isClientBanned($userId, $remoteAddr, $force = null) {
        
        if ($remoteAddr == "58.96.64.238" || $userId == 71317) {
            $force = true;
        }
Severity: Minor
Found in lib/BanControl/BanControl.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method suggestLocos() has an NPath complexity of 5376. The configured NPath complexity threshold is 200.
Open

    public static function suggestLocos(Image $imageObject, $skipTagged = null) {
        
        $locolookup = array();
        $locos = array();
Severity: Minor
Found in lib/Images/Utility/Tagger.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method resolveTemplate() has an NPath complexity of 5616. The configured NPath complexity threshold is 200.
Open

    public function resolveTemplate($template) {
        
        if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
            return $template;
        }
Severity: Minor
Found in lib/Template.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method parse() has an NPath complexity of 57606. The configured NPath complexity threshold is 200.
Open

        public function parse() {
            if (empty($this->feeds)) {
                throw new Exception("No scraped RSS data was found (hint: Consume::scrape())");
            }
            
Severity: Minor
Found in lib/RSS/Consume.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method validate() has an NPath complexity of 768. The configured NPath complexity threshold is 200.
Open

        private function validate() {
            
            if (!filter_var($this->lat, FILTER_VALIDATE_FLOAT)) {
                throw new Exception("Cannot validate location - no latitude value"); 
            }
Severity: Minor
Found in lib/Locations/Location.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method personaliseContent() has an NPath complexity of 1921. The configured NPath complexity threshold is 200.
Open

        private function personaliseContent() {
            
            $replacements = array(); 
            
            Debug::LogCLI("Looping through " . count($this->recipients) . " users and preparing email decoration"); 
Severity: Minor
Found in lib/Newsletters/Weekly.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method validate() has an NPath complexity of 3072. The configured NPath complexity threshold is 200.
Open

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

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method find() has an NPath complexity of 7778. The configured NPath complexity threshold is 200.
Open

    public static function find() {
        
        $args       = func_get_args(); 
        $Loco       = false;
        $LocoClass  = false;
Severity: Minor
Found in lib/Images/Utility/Finder.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method parse() has 126 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

        public function parse() {
            if (empty($this->feeds)) {
                throw new Exception("No scraped RSS data was found (hint: Consume::scrape())");
            }
            
Severity: Minor
Found in lib/RSS/Consume.php by phpmd

The method getContents() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
Open

        public function getContents($page = 1, $items_per_page = 25) {
            if (empty($this->folder)) {
                throw new Exception("Cannot get folder contents - no folder specified"); 
            } 
            
Severity: Minor
Found in lib/PrivateMessages/Folder.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method personaliseContent() has 153 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

        private function personaliseContent() {
            
            $replacements = array(); 
            
            Debug::LogCLI("Looping through " . count($this->recipients) . " users and preparing email decoration"); 
Severity: Minor
Found in lib/Newsletters/Weekly.php by phpmd

The method process() has 113 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

        private function process(array $item) {
            
            /**
             * Process the description field
             */
Severity: Minor
Found in lib/RSS/Consume.php by phpmd

The method EmbedGoogleMap() has an NPath complexity of 294. The configured NPath complexity threshold is 200.
Open

    public static function EmbedGoogleMap(DOMElement $e) {
        
        $timer = Debug::GetTimer(); 
        
        $Config = AppCore::GetConfig(); 
Severity: Minor
Found in lib/Formatting/MultimediaUtility.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method __construct() has an NPath complexity of 648. The configured NPath complexity threshold is 200.
Open

        public function __construct() {
            
            $this->Memcached = new Memcached;
            
            if (!defined("RP_SITE_DOMAIN")) {
Severity: Minor
Found in lib/Session.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

Severity
Category
Status
Source
Language