Function getFooterIconsData
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public static function getFooterIconsData( Config $config ) {
$footericons = [];
foreach (
$config->get( MainConfigNames::FooterIcons ) as $footerIconsKey => &$footerIconsBlock
) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getFooterIcons
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getFooterIcons(): array {
$dataIcons = [];
$skinContext = $this->skinContext;
// If footer icons are enabled append to the end of the rows
$footerIcons = $skinContext->getFooterIcons();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getFooterIcons
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFooterIcons(): array {
$dataIcons = [];
$skinContext = $this->skinContext;
// If footer icons are enabled append to the end of the rows
$footerIcons = $skinContext->getFooterIcons();
Method makeFooterIconHTML
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function makeFooterIconHTML( Config $config, $icon, string $withImage = 'withImage' ): string {
if ( is_string( $icon ) ) {
$html = $icon;
} else { // Assuming array
$url = $icon['url'] ?? null;
Method getFooterInfoData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFooterInfoData(): array {
$action = null;
$skinContext = $this->skinContext;
$out = $skinContext->getOutput();
$ctx = $skinContext->getContextSource();
Function makeFooterIconHTML
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function makeFooterIconHTML( Config $config, $icon, string $withImage = 'withImage' ): string {
if ( is_string( $icon ) ) {
$html = $icon;
} else { // Assuming array
$url = $icon['url'] ?? null;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getSiteFooterLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getSiteFooterLinks(): array {
$siteLinksData = [];
$siteLinks = [
'privacy' => [ 'privacy', 'privacypage' ],
'about' => [ 'aboutsite', 'aboutpage' ],
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"