XoopsModules25x/xoopspoll

View on GitHub

Showing 300 of 2,846 total issues

The function xoopspollBlockSinglepollShow() has an NPath complexity of 2331. The configured NPath complexity threshold is 200.
Open

function xoopspollBlockSinglepollShow(mixed $options): array
{
    $block = [];

    /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in blocks/singlepoll.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 listBlocks() has 180 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function listBlocks(): void
    {
        $pathIcon16 = Admin::iconUrl('', '16');

        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
Severity: Minor
Found in class/Common/Blocksadmin.php by phpmd

The function xoopspollBlockMultiShow() has 133 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

function xoopspollBlockMultiShow(array $options): array
{
    $block           = [];
    $pollOptionArray = [];
    /** @var \XoopsModuleHandler $moduleHandler */
Severity: Minor
Found in blocks/multipoll.php by phpmd

The function xoopspollBlockSinglepollEdit() has 144 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

function xoopspollBlockSinglepollEdit(mixed $options): string
{
    /**
     * Options[]
     *            0 = show expired polls in block
Severity: Minor
Found in blocks/singlepoll.php by phpmd

The method listBlocks() has an NPath complexity of 15553. The configured NPath complexity threshold is 200.
Open

    public function listBlocks(): void
    {
        $pathIcon16 = Admin::iconUrl('', '16');

        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
Severity: Minor
Found in class/Common/Blocksadmin.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 isBlockCloned() has an NPath complexity of 1152. The configured NPath complexity threshold is 200.
Open

    public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups, bool $redirect = true)
    {
        \xoops_loadLanguage('admin', 'system');
        \xoops_loadLanguage('admin/blocksadmin', 'system');
        \xoops_loadLanguage('admin/groups', 'system');
Severity: Minor
Found in class/Common/Blocksadmin.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 orderBlock has 14 parameters. Consider reducing the number of parameters to less than 10.
Open

    public function orderBlock(
        array $bid,
        array $oldtitle,
        array $oldside,
        array $oldweight,
Severity: Minor
Found in class/Common/Blocksadmin.php by phpmd

The method approve() has an NPath complexity of 1536. The configured NPath complexity threshold is 200.
Open

    public function approve(&$post, $force = false)
    {
        if (empty($post)) {
            return false;
        }

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 insert() has 113 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function insert(\XoopsObject $post, $force = true)
    {
        // Set the post time
        // The time should be 'publish' time. To be adjusted later
        if (!$post->getVar('post_time')) {

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

    public function showPost($isadmin)
    {
        global $myts;
        global $forumUrl, $forumImage;
        global $viewtopic_users, $viewtopic_posters, $forum_obj, $topic_obj, $online, $user_karma, $viewmode, $order, $start, $total_posts, $topic_status;

The method _delete() has an NPath complexity of 19929. The configured NPath complexity threshold is 200.
Open

    private function _delete($post, $force = false)
    {
        if ((!$post instanceof Post) || (0 === $post->getVar('post_id'))) {
            return false;
        }

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 getUserbar() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
Open

    public function getUserbar()
    {
        global $xoopsModuleConfig, $xoopsUser, $isadmin;
        if (empty($GLOBALS['xoopsModuleConfig']['userbar_enabled'])) {
            return null;

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 approve() has an NPath complexity of 1536. The configured NPath complexity threshold is 200.
Open

    public function approve(&$post, $force = false)
    {
        if (empty($post)) {
            return false;
        }

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 showPost() has 151 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function showPost($isadmin)
    {
        global $xoopsConfig, $xoopsModule, $xoopsUser, $myts;
        /** @var Xoopspoll\Helper $helper */
        $helper = Xoopspoll\Helper::getInstance();

The method insert() has an NPath complexity of 1632. The configured NPath complexity threshold is 200.
Open

    public function insert(\XoopsObject $post, $force = true)
    {
        // Set the post time
        // The time should be 'publish' time. To be adjusted later
        if (!$post->getVar('post_time')) {

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 insert() has an NPath complexity of 1632. The configured NPath complexity threshold is 200.
Open

    public function insert(\XoopsObject $post, $force = true)
    {
        global $xoopsUser;

        // Set the post time

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 _delete() has 131 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    private function _delete($post, $force = false)
    {
        if ((!$post instanceof Post) || (0 === $post->getVar('post_id'))) {
            return false;
        }

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

    public function insert(\XoopsObject $post, $force = true)
    {
        global $xoopsUser;

        // Set the post time

The method _delete() has an NPath complexity of 9639. The configured NPath complexity threshold is 200.
Open

    public function _delete($post, $force = false)
    {
        global $xoopsModule;

        if (!is_object($post) || 0 == $post->getVar('post_id')) {

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 _delete() has 105 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function _delete($post, $force = false)
    {
        global $xoopsModule;

        if (!is_object($post) || 0 == $post->getVar('post_id')) {
Severity
Category
Status
Source
Language