Code Duplication    Length = 3-4 lines in 4 locations

votepolls.php 4 locations

@@ 102-104 (lines=3) @@
99
                        /* there was a problem registering the vote */
100
                        redirect_header($GLOBALS['xoops']->buildUrl('index.php', ['poll_id' => $poll_id]), $classConstants::REDIRECT_DELAY_MEDIUM, constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE_ERROR'));
101
                    }
102
                } else {
103
                    $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_ALREADYVOTED');
104
                }
105
                /* set anon user vote (and the time they voted) */
106
                if (!is_object($GLOBALS['xoopsUser'])) {
107
                    xoops_load('pollUtility', $GLOBALS['xoopsModuleConfig']['poll_module']);
@@ 112-114 (lines=3) @@
109
                    $classPollUtility = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'PollUtility';
110
                    $classPollUtility::setVoteCookie($poll_id, $voteTime, 0);
111
                }
112
            } else {
113
                $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_CANNOTVOTE');
114
            }
115
        } else {
116
            /* poll has expired so just show the results */
117
            $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . 'SORRYEXPIRED');
@@ 115-118 (lines=4) @@
112
            } else {
113
                $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_CANNOTVOTE');
114
            }
115
        } else {
116
            /* poll has expired so just show the results */
117
            $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . 'SORRYEXPIRED');
118
        }
119
    } else {
120
        $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_ERROR_INVALID_POLLID');
121
    }
@@ 119-121 (lines=3) @@
116
            /* poll has expired so just show the results */
117
            $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . 'SORRYEXPIRED');
118
        }
119
    } else {
120
        $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_ERROR_INVALID_POLLID');
121
    }
122
    if (null !== $url) {
123
        redirect_header($url, $classConstants::REDIRECT_DELAY_MEDIUM, $msg);
124
    } else {