| Conditions | 6 |
| Paths | 2 |
| Total Lines | 53 |
| Code Lines | 33 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 89 | public function getFormRepositories($action = false, $start = 0, $limit = 0) |
||
| 90 | {
|
||
| 91 | if (!$action) {
|
||
| 92 | $action = $_SERVER['REQUEST_URI']; |
||
| 93 | } |
||
| 94 | |||
| 95 | // Get Theme Form |
||
| 96 | \xoops_load('XoopsFormLoader');
|
||
| 97 | $form = new \XoopsThemeForm(\_AM_WGGITHUB_REPOSITORY_EDIT, 'form', $action, 'post', true); |
||
| 98 | $form->setExtra('enctype="multipart/form-data"');
|
||
| 99 | // Form Text repoNodeid |
||
| 100 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_NODEID, 'repo_nodeid', 50, 255, $this->getVar('repo_nodeid')));
|
||
| 101 | // Form Text repoUser |
||
| 102 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_USER, 'repo_user', 50, 255, $this->getVar('repo_user')), true);
|
||
| 103 | // Form Text repoName |
||
| 104 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_NAME, 'repo_name', 50, 255, $this->getVar('repo_name')), true);
|
||
| 105 | // Form Text repoFullname |
||
| 106 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_FULLNAME, 'repo_fullname', 50, 255, $this->getVar('repo_fullname')));
|
||
| 107 | // Form Text Date Select repoCreatedat |
||
| 108 | $repoCreatedat = $this->isNew() ?: $this->getVar('repo_createdat');
|
||
| 109 | $form->addElement(new \XoopsFormTextDateSelect(\_AM_WGGITHUB_REPOSITORY_CREATEDAT, 'repo_createdat', '', $repoCreatedat)); |
||
| 110 | // Form Text Date Select repoUpdatedat |
||
| 111 | $repoUpdatedat = $this->isNew() ?: $this->getVar('repo_updatedat');
|
||
| 112 | $form->addElement(new \XoopsFormTextDateSelect(\_AM_WGGITHUB_REPOSITORY_UPDATEDAT, 'repo_updatedat', '', $repoUpdatedat)); |
||
| 113 | // Form Text repoHtmlurl |
||
| 114 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_HTMLURL, 'repo_htmlurl', 50, 255, $this->getVar('repo_htmlurl')));
|
||
| 115 | // Form Text repoReadme |
||
| 116 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_README, 'repo_readme', 50, 255, $this->getVar('repo_readme')));
|
||
| 117 | // Form Text repoPrerelease |
||
| 118 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_PRERELEASE, 'repo_prerelease', 50, 255, $this->getVar('repo_prerelease')));
|
||
| 119 | // Form Text repoRelease |
||
| 120 | $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_REPOSITORY_RELEASE, 'repo_release', 50, 255, $this->getVar('repo_prelease')));
|
||
| 121 | // Form Radio Yes/No repoApproved |
||
| 122 | $repoApproved = $this->isNew() ?: $this->getVar('repo_approved');
|
||
| 123 | $form->addElement(new \XoopsFormRadioYN(\_AM_WGGITHUB_REPOSITORY_APPROVED, 'repo_approved', $repoApproved)); |
||
| 124 | // Form Select Status repoStatus |
||
| 125 | $repoStatusSelect = new \XoopsFormSelect(\_AM_WGGITHUB_REPOSITORY_STATUS, 'repo_status', $this->getVar('repo_status'));
|
||
| 126 | $repoStatusSelect->addOption(Constants::STATUS_NONE, \_AM_WGGITHUB_STATUS_NONE); |
||
| 127 | $repoStatusSelect->addOption(Constants::STATUS_UPTODATE, \_AM_WGGITHUB_STATUS_UPTODATE); |
||
| 128 | $repoStatusSelect->addOption(Constants::STATUS_UPDATED, \_AM_WGGITHUB_STATUS_UPDATED); |
||
| 129 | $repoStatusSelect->addOption(Constants::STATUS_OFFLINE, \_AM_WGGITHUB_STATUS_OFFLINE); |
||
| 130 | $form->addElement($repoStatusSelect); |
||
| 131 | // Form Text Date Select repoDatecreated |
||
| 132 | $repoDatecreated = $this->isNew() ?: $this->getVar('repo_datecreated');
|
||
| 133 | $form->addElement(new \XoopsFormTextDateSelect(\_AM_WGGITHUB_REPOSITORY_DATECREATED, 'repo_datecreated', '', $repoDatecreated)); |
||
| 134 | // Form Select User repoSubmitter |
||
| 135 | $form->addElement(new \XoopsFormSelectUser(\_AM_WGGITHUB_REPOSITORY_SUBMITTER, 'repo_submitter', false, $this->getVar('repo_submitter')));
|
||
| 136 | // To Save |
||
| 137 | $form->addElement(new \XoopsFormHidden('op', 'save'));
|
||
| 138 | $form->addElement(new \XoopsFormHidden('start', $start));
|
||
| 139 | $form->addElement(new \XoopsFormHidden('limit', $limit));
|
||
| 140 | $form->addElement(new \XoopsFormButtonTray('', \_SUBMIT, 'submit', '', false));
|
||
| 141 | return $form; |
||
| 142 | } |
||
| 207 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths