ImpressCMS/impresscms

View on GitHub
htdocs/header.php

Summary

Maintainability
C
1 day
Test Coverage

Reference to static property logger from undeclared class \icms
Open

icms::$logger->stopTime('Module init');
Severity: Critical
Found in htdocs/header.php by phan

Reference to static property logger from undeclared class \icms
Open

icms::$logger->startTime('Module display');
Severity: Critical
Found in htdocs/header.php by phan

Reference to static property preload from undeclared class \icms
Open

icms::$preload->triggerEvent('startOutputInit');
Severity: Critical
Found in htdocs/header.php by phan

Invalid offset "theme_set_allowed" of array type array{startpage:,template_set:mixed}
Open

$xoopsThemeFactory->allowedThemes = $icmsConfig['theme_set_allowed'];
Severity: Minor
Found in htdocs/header.php by phan

Reference to static property module from undeclared class \icms
Open

if (icms::$module) $xoTheme->contentCacheLifetime = @$icmsConfig['module_cache'][icms::$module->getVar('mid', 'n')];
Severity: Critical
Found in htdocs/header.php by phan

Variable $icmsConfigPlugins is undeclared
Open

if (!empty($icmsConfigPlugins['sanitizer_plugins'])) {
Severity: Minor
Found in htdocs/header.php by phan

Invalid offset "module_cache" of array type array{startpage:,template_set:mixed}
Open

if (icms::$module) $xoTheme->contentCacheLifetime = @$icmsConfig['module_cache'][icms::$module->getVar('mid', 'n')];
Severity: Minor
Found in htdocs/header.php by phan

Invalid offset "language" of array type array{startpage:,template_set:mixed}
Open

$xoopsTpl->assign('icmsLang', $icmsConfig['language']);
Severity: Minor
Found in htdocs/header.php by phan

Call to method __construct from undeclared class \icms_view_theme_Factory
Open

$xoopsThemeFactory = new icms_view_theme_Factory();
Severity: Critical
Found in htdocs/header.php by phan

Invalid offset "theme_set" of array type array{startpage:,template_set:mixed}
Open

$xoopsThemeFactory->defaultTheme = $icmsConfig['theme_set'];
Severity: Minor
Found in htdocs/header.php by phan

Reference to static property logger from undeclared class \icms
Open

icms::$logger->startTime('ICMS output init');
Severity: Critical
Found in htdocs/header.php by phan

Reference to static property logger from undeclared class \icms
Open

icms::$logger->stopTime('ICMS output init');
Severity: Critical
Found in htdocs/header.php by phan

Reference to instance property defaultTheme from undeclared class \icms_view_theme_Factory
Open

$xoopsThemeFactory->defaultTheme = $icmsConfig['theme_set'];
Severity: Minor
Found in htdocs/header.php by phan

Reference to instance property allowedThemes from undeclared class \icms_view_theme_Factory
Open

$xoopsThemeFactory->allowedThemes = $icmsConfig['theme_set_allowed'];
Severity: Minor
Found in htdocs/header.php by phan

Call to method createInstance from undeclared class \icms_view_theme_Factory
Open

$icmsTheme = $xoTheme = &$xoopsThemeFactory->createInstance(array('contentTemplate' => @$xoopsOption['template_main']));
Severity: Critical
Found in htdocs/header.php by phan

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

if (!empty($icmsConfigPlugins['sanitizer_plugins'])) {
    foreach ($icmsConfigPlugins['sanitizer_plugins'] as $key) {
        if (empty($key)) continue;
        if (file_exists(ICMS_PLUGINS_PATH . '/textsanitizer/' . $key . '/' . $key . '.css')) {
            $xoTheme->addStylesheet(ICMS_PLUGINS_URL . '/textsanitizer/' . $key . '/' . $key . '.css', array('media' => 'screen'));
Severity: Major
Found in htdocs/header.php and 1 other location - About 1 day to fix
htdocs/include/cp_functions.php on lines 183..203

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 251.

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

TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE"
Open

    if (FALSE === strpos($xoopsOption['template_main'], ':')) {
Severity: Minor
Found in htdocs/header.php by phpcodesniffer

Inline control structures are not allowed
Open

if (icms::$module) $xoTheme->contentCacheLifetime = @$icmsConfig['module_cache'][icms::$module->getVar('mid', 'n')];
Severity: Minor
Found in htdocs/header.php by phpcodesniffer

Inline control structures are not allowed
Open

        if (empty($key)) continue;
Severity: Minor
Found in htdocs/header.php by phpcodesniffer

There are no issues that match your filters.

Category
Status