XoopsModules25x/apcal

View on GitHub
include/preferences.inc.php

Summary

Maintainability
C
1 day
Test Coverage

Avoid deeply nested control flow statements.
Open

                    if (!$tpl_updated && $config->getVar('conf_catid') == XOOPS_CONF
                        && $config->getVar('conf_name') === 'template_set'
                    ) {
                        // clear cached/compiled files and regenerate them if default theme has been changed
                        if ($xoopsConfig['template_set'] != $_POST[$config->getVar('conf_name')]) {
Severity: Major
Found in include/preferences.inc.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF
                            && $config->getVar('conf_name') === 'startpage'
                        ) {
                            $memberHandler     = xoops_getHandler('member');
                            $groups             = $memberHandler->getGroupList();
    Severity: Major
    Found in include/preferences.inc.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if (!$theme_updated && $config->getVar('conf_catid') == XOOPS_CONF
                              && $config->getVar('conf_name') === 'theme_set'
                          ) {
                              $memberHandler = xoops_getHandler('member');
                              $memberHandler->updateUsersByField('theme', $_POST[$config->getVar('conf_name')]);
      Severity: Major
      Found in include/preferences.inc.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF
                                && $config->getVar('conf_name') === 'language'
                            ) {
                                // regenerate admin menu file
                                $xoopsConfig['language'] = $_POST[$config->getVar('conf_name')];
        Severity: Major
        Found in include/preferences.inc.php - About 45 mins to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                              for ($j = 0; $j < $opcount; ++$j) {
                                  $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
                                  $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
                                  $ele->addOption($optval, $optkey);
                              }
          Severity: Major
          Found in include/preferences.inc.php and 1 other location - About 3 hrs to fix
          include/preferences.inc.php on lines 111..115

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 144.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                              for ($j = 0; $j < $opcount; ++$j) {
                                  $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
                                  $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
                                  $ele->addOption($optval, $optkey);
                              }
          Severity: Major
          Found in include/preferences.inc.php and 1 other location - About 3 hrs to fix
          include/preferences.inc.php on lines 101..105

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 144.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Only one argument is allowed per line in a multi-line function call
          Open

                                  $ele = ($config[$i]->getVar('conf_value') !== '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'),
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Only one argument is allowed per line in a multi-line function call
          Open

                                                                                                            $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5,
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 145 characters
          Open

                  if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) {
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 156 characters
          Open

                      //      $form->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex')));
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 177 characters
          Open

                                                                                                            $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5,
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 165 characters
          Open

                                  $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 165 characters
          Open

                                  $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 164 characters
          Open

                              $ele  = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 175 characters
          Open

                                                                                                                                           . '<br><br><span style="font-weight:normal;">'
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 168 characters
          Open

                                  $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 121 characters
          Open

                              $options = $configHandler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 148 characters
          Open

                              $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 173 characters
          Open

                                                                                                                                           . constant($config[$i]->getVar('conf_desc'))
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 147 characters
          Open

                              $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 121 characters
          Open

                                                                               . '/admin/admin.php?fct=preferences&op=showmod&mod='
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 172 characters
          Open

                                     || constant($config[$i]->getVar('conf_desc')) === '') ? constant($config[$i]->getVar('conf_title')) : constant($config[$i]->getVar('conf_title'))
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 158 characters
          Open

                              $ele  = new XoopsFormColorPicker($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 149 characters
          Open

                              $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 168 characters
          Open

                                  $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 139 characters
          Open

                              $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 148 characters
          Open

                              $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 128 characters
          Open

                                          $found = $tplfileHandler->find($newtplset, 'block', $dtemplates[$j]->getVar('tpl_refid'), null);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 143 characters
          Open

                      require_once XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php';
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 179 characters
          Open

                                                                                                            50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 144 characters
          Open

                                          if (!$fp = fopen(XOOPS_CACHE_PATH . '/' . $newtplset . '_' . $imagefiles[$j]->getVar('imgsetimg_file'), 'wb')) {
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 165 characters
          Open

                                  $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 160 characters
          Open

                              $ele  = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 121 characters
          Open

                              $options = $configHandler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 139 characters
          Open

                                  $ele = ($config[$i]->getVar('conf_value') !== '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'),
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 131 characters
          Open

                              $ele     = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Line exceeds 120 characters; contains 140 characters
          Open

                              $ele     = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Multi-line function call not indented correctly; expected 24 spaces but found 98
          Open

                                                                                                            50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Multi-line function call not indented correctly; expected 28 spaces but found 98
          Open

                                                                                                            $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5,
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Opening parenthesis of a multi-line function call must be the last content on the line
          Open

                                  $ele = ($config[$i]->getVar('conf_value') !== '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'),
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          Closing parenthesis of a multi-line function call must be on a line by itself
          Open

                                                                                                            50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
          Severity: Minor
          Found in include/preferences.inc.php by phpcodesniffer

          There are no issues that match your filters.

          Category
          Status