railpage/railpagecore

View on GitHub

Showing 1,011 of 9,214 total issues

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

    public function validate($ignore = false) {

        if (empty( $this->username )) {
            throw new Exception("Username cannot be empty");
        }
Severity: Minor
Found in lib/Users/User.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 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 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 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 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 format() has 141 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public static function format($userAvatar = null, $width = 100, $height = 100) {
        if (is_null($userAvatar)) {
            return false;
        }
        
Severity: Minor
Found in lib/Users/Utility/AvatarUtility.php by phpmd

The method load() has an NPath complexity of 27648. The configured NPath complexity threshold is 200.
Open

    public function load($userId = false) {

        if (filter_var($userId, FILTER_VALIDATE_INT)) {
            $this->id = $userId;
        }
Severity: Minor
Found in lib/Users/User.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 format() has an NPath complexity of 9331200. The configured NPath complexity threshold is 200.
Open

    public static function format($userAvatar = null, $width = 100, $height = 100) {
        if (is_null($userAvatar)) {
            return false;
        }
        
Severity: Minor
Found in lib/Users/Utility/AvatarUtility.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 getWeatherForecast() has 140 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function getWeatherForecast($days = 14) {
        
        return false;
        
        $weather = false;
Severity: Minor
Found in lib/Place.php by phpmd

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

    private function load($option = null) {

        Debug::RecordInstance();

        $this->mckey = sprintf("railpage:image=%d", $this->id);
Severity: Minor
Found in lib/Images/Image.php by phpmd

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

        public function commit() {

            $this->validate();

            if (function_exists("prepare_submit")) {
Severity: Minor
Found in lib/News/Article.php by phpmd

The method findArticles() has an NPath complexity of 9000. The configured NPath complexity threshold is 200.
Open

        public function findArticles($offset = 0, $limit = 25, $orderby = "story_time_unix") {
            
            if (empty($this->filter_topics) || empty($this->filter_words)) {
                $this->getFilters();
            }
Severity: Minor
Found in lib/News/Feed.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 class User has 2888 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class User extends Base {

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

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

    public function load($userId = false) {

        if (filter_var($userId, FILTER_VALIDATE_INT)) {
            $this->id = $userId;
        }
Severity: Minor
Found in lib/Users/User.php by phpmd

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

    public function __construct() {
        global $ZendDB, $ZendDB_ReadOnly, $PHPUnitTest;
        
        /**
         * Create the registry
Severity: Minor
Found in lib/AppCore.php by phpmd

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

    public function populate($force = false, $option = null) {

        if ($force === false && !$this->isStale()) {
            return $this;
        }
Severity: Minor
Found in lib/Images/Image.php by phpmd

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

    public static function getWOEData($lookup = false, $types = false) {
        if ($lookup === false) {
            return false;
        }
        
Severity: Minor
Found in lib/Place.php by phpmd

The method cacheGeoData() has an NPath complexity of 216. The configured NPath complexity threshold is 200.
Open

    private function cacheGeoData() {

        if (!$this->Place instanceof Place) {
            return $this;
        }
Severity: Minor
Found in lib/Images/Image.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 fetch() has an NPath complexity of 1474656. The configured NPath complexity threshold is 200.
Open

        public function fetch($id = false) {
            if ($id) {
                $this->id = $id;
            }
Severity: Minor
Found in lib/News/Article.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