wikimedia/mediawiki-core

View on GitHub
includes/skins/Skin.php

Summary

Maintainability
F
2 wks
Test Coverage

File Skin.php has 1438 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
Severity: Major
Found in includes/skins/Skin.php - About 3 days to fix

    Skin has 71 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class Skin extends ContextSource {
        use ProtectedHookAccessorTrait;
    
        /**
         * @var array link options used in Skin::makeLink. Can be set by skin option `link`.
    Severity: Major
    Found in includes/skins/Skin.php - About 1 day to fix

      Function addToSidebarPlain has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addToSidebarPlain( &$bar, $text ) {
              $lines = explode( "\n", $text );
      
              $heading = '';
              $config = $this->getConfig();
      Severity: Minor
      Found in includes/skins/Skin.php - About 7 hrs to fix

      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 buildNavUrls has 128 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function buildNavUrls() {
              $out = $this->getOutput();
              $title = $this->getTitle();
              $thispage = $title->getPrefixedDBkey();
              $uploadNavigationUrl = $this->getConfig()->get( MainConfigNames::UploadNavigationUrl );
      Severity: Major
      Found in includes/skins/Skin.php - About 5 hrs to fix

        Function getLanguages has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getLanguages() {
                if ( $this->getConfig()->get( MainConfigNames::HideInterlanguageLinks ) ) {
                    return [];
                }
                if ( $this->languageLinks === null ) {
        Severity: Minor
        Found in includes/skins/Skin.php - About 4 hrs to fix

        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 buildNavUrls has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function buildNavUrls() {
                $out = $this->getOutput();
                $title = $this->getTitle();
                $thispage = $title->getPrefixedDBkey();
                $uploadNavigationUrl = $this->getConfig()->get( MainConfigNames::UploadNavigationUrl );
        Severity: Minor
        Found in includes/skins/Skin.php - About 4 hrs to fix

        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 getNewtalks has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getNewtalks() {
                if ( $this->hideNewTalkMessagesForCurrentSession() ) {
                    return '';
                }
        
        
        Severity: Major
        Found in includes/skins/Skin.php - About 3 hrs to fix

          Method getLanguages has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getLanguages() {
                  if ( $this->getConfig()->get( MainConfigNames::HideInterlanguageLinks ) ) {
                      return [];
                  }
                  if ( $this->languageLinks === null ) {
          Severity: Major
          Found in includes/skins/Skin.php - About 2 hrs to fix

            Method addToSidebarPlain has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function addToSidebarPlain( &$bar, $text ) {
                    $lines = explode( "\n", $text );
            
                    $heading = '';
                    $config = $this->getConfig();
            Severity: Major
            Found in includes/skins/Skin.php - About 2 hrs to fix

              Method getDefaultModules has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getDefaultModules() {
                      $out = $this->getOutput();
                      $user = $this->getUser();
              
                      // Modules declared in the $modules literal are loaded
              Severity: Major
              Found in includes/skins/Skin.php - About 2 hrs to fix

                Function getSiteNotice has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getSiteNotice() {
                        $siteNotice = '';
                
                        if ( $this->getHookRunner()->onSiteNoticeBefore( $siteNotice, $this ) ) {
                            if ( $this->getUser()->isRegistered() ) {
                Severity: Minor
                Found in includes/skins/Skin.php - About 2 hrs to fix

                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 getTemplateData has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getTemplateData() {
                        $title = $this->getTitle();
                        $out = $this->getOutput();
                        $user = $this->getUser();
                        $isMainPage = $title->isMainPage();
                Severity: Major
                Found in includes/skins/Skin.php - About 2 hrs to fix

                  Function subPageSubtitleInternal has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function subPageSubtitleInternal() {
                          $services = MediaWikiServices::getInstance();
                          $linkRenderer = $services->getLinkRenderer();
                          $out = $this->getOutput();
                          $title = $out->getTitle();
                  Severity: Minor
                  Found in includes/skins/Skin.php - About 2 hrs to fix

                  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 getCategoryLinks has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getCategoryLinks() {
                          $out = $this->getOutput();
                          $allCats = $out->getCategoryLinks();
                          $title = $this->getTitle();
                          $services = MediaWikiServices::getInstance();
                  Severity: Major
                  Found in includes/skins/Skin.php - About 2 hrs to fix

                    Function getPersonalToolsForMakeListItem has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        final public function getPersonalToolsForMakeListItem( $urls, $applyClassesToListItems = false ) {
                            $personal_tools = [];
                            foreach ( $urls as $key => $plink ) {
                                # The class on a personal_urls item is meant to go on the <a> instead
                                # of the <li> so we have to use a single item "links" array instead
                    Severity: Minor
                    Found in includes/skins/Skin.php - About 1 hr to fix

                    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 getUndeleteLink has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getUndeleteLink() {
                            $action = $this->getRequest()->getRawVal( 'action', 'view' );
                            $title = $this->getTitle();
                            $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
                    
                    
                    Severity: Minor
                    Found in includes/skins/Skin.php - About 1 hr to fix

                    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 makeToolbox has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function makeToolbox( $navUrls, $feedUrls ) {
                            $toolbox = [];
                            if ( $navUrls['whatlinkshere'] ?? null ) {
                                $toolbox['whatlinkshere'] = $navUrls['whatlinkshere'];
                                $toolbox['whatlinkshere']['id'] = 't-whatlinkshere';
                    Severity: Minor
                    Found in includes/skins/Skin.php - About 1 hr to fix

                      Function getNewtalks has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getNewtalks() {
                              if ( $this->hideNewTalkMessagesForCurrentSession() ) {
                                  return '';
                              }
                      
                      
                      Severity: Minor
                      Found in includes/skins/Skin.php - About 1 hr to fix

                      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 subPageSubtitleInternal has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function subPageSubtitleInternal() {
                              $services = MediaWikiServices::getInstance();
                              $linkRenderer = $services->getLinkRenderer();
                              $out = $this->getOutput();
                              $title = $out->getTitle();
                      Severity: Minor
                      Found in includes/skins/Skin.php - About 1 hr to fix

                        Method getPersonalToolsForMakeListItem has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            final public function getPersonalToolsForMakeListItem( $urls, $applyClassesToListItems = false ) {
                                $personal_tools = [];
                                foreach ( $urls as $key => $plink ) {
                                    # The class on a personal_urls item is meant to go on the <a> instead
                                    # of the <li> so we have to use a single item "links" array instead
                        Severity: Minor
                        Found in includes/skins/Skin.php - About 1 hr to fix

                          Method getUndeleteLink has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getUndeleteLink() {
                                  $action = $this->getRequest()->getRawVal( 'action', 'view' );
                                  $title = $this->getTitle();
                                  $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
                          
                          
                          Severity: Minor
                          Found in includes/skins/Skin.php - About 1 hr to fix

                            Method buildSidebar has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function buildSidebar() {
                                    if ( $this->sidebar === null ) {
                                        $services = MediaWikiServices::getInstance();
                                        $callback = function ( $old = null, &$ttl = null ) {
                                            $bar = [];
                            Severity: Minor
                            Found in includes/skins/Skin.php - About 1 hr to fix

                              Function getDefaultModules has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getDefaultModules() {
                                      $out = $this->getOutput();
                                      $user = $this->getUser();
                              
                                      // Modules declared in the $modules literal are loaded
                              Severity: Minor
                              Found in includes/skins/Skin.php - About 1 hr to fix

                              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 getCachedNotice has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function getCachedNotice( $name ) {
                                      $config = $this->getConfig();
                              
                                      if ( $name === 'default' ) {
                                          // special case
                              Severity: Minor
                              Found in includes/skins/Skin.php - About 1 hr to fix

                                Method doEditSectionLink has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function doEditSectionLink( Title $nt, $section, $sectionTitle, Language $lang ) {
                                        // HTML generated here should probably have userlangattributes
                                        // added to it for LTR text on RTL pages
                                
                                        $attribs = [];
                                Severity: Minor
                                Found in includes/skins/Skin.php - About 1 hr to fix

                                  Function getRelevantUser has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function getRelevantUser(): ?UserIdentity {
                                          if ( $this->mRelevantUser === false ) {
                                              $this->mRelevantUser = null; // false indicates we never attempted to load it.
                                              $title = $this->getRelevantTitle();
                                              if ( $title->hasSubjectNamespace( NS_USER ) ) {
                                  Severity: Minor
                                  Found in includes/skins/Skin.php - About 1 hr to fix

                                  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 makeToolbox has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function makeToolbox( $navUrls, $feedUrls ) {
                                          $toolbox = [];
                                          if ( $navUrls['whatlinkshere'] ?? null ) {
                                              $toolbox['whatlinkshere'] = $navUrls['whatlinkshere'];
                                              $toolbox['whatlinkshere']['id'] = 't-whatlinkshere';
                                  Severity: Minor
                                  Found in includes/skins/Skin.php - About 1 hr to fix

                                  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 normalizeKey has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function normalizeKey( string $key ) {
                                          $config = MediaWikiServices::getInstance()->getMainConfig();
                                          $defaultSkin = $config->get( MainConfigNames::DefaultSkin );
                                          $fallbackSkin = $config->get( MainConfigNames::FallbackSkin );
                                          $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
                                  Severity: Minor
                                  Found in includes/skins/Skin.php - About 1 hr to fix

                                    Method preloadExistence has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function preloadExistence() {
                                            $titles = [];
                                    
                                            // User/talk link
                                            $user = $this->getUser();
                                    Severity: Minor
                                    Found in includes/skins/Skin.php - About 1 hr to fix

                                      Method getSiteNotice has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getSiteNotice() {
                                              $siteNotice = '';
                                      
                                              if ( $this->getHookRunner()->onSiteNoticeBefore( $siteNotice, $this ) ) {
                                                  if ( $this->getUser()->isRegistered() ) {
                                      Severity: Minor
                                      Found in includes/skins/Skin.php - About 1 hr to fix

                                        Function getCategoryLinks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public function getCategoryLinks() {
                                                $out = $this->getOutput();
                                                $allCats = $out->getCategoryLinks();
                                                $title = $this->getTitle();
                                                $services = MediaWikiServices::getInstance();
                                        Severity: Minor
                                        Found in includes/skins/Skin.php - About 1 hr to fix

                                        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 getTemplateData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public function getTemplateData() {
                                                $title = $this->getTitle();
                                                $out = $this->getOutput();
                                                $user = $this->getUser();
                                                $isMainPage = $title->isMainPage();
                                        Severity: Minor
                                        Found in includes/skins/Skin.php - About 1 hr to fix

                                        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 getPageClasses has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public function getPageClasses( $title ) {
                                                $services = MediaWikiServices::getInstance();
                                                $ns = $title->getNamespace();
                                                $numeric = 'ns-' . $ns;
                                        
                                        
                                        Severity: Minor
                                        Found in includes/skins/Skin.php - About 1 hr to fix

                                        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 preloadExistence has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            private function preloadExistence() {
                                                $titles = [];
                                        
                                                // User/talk link
                                                $user = $this->getUser();
                                        Severity: Minor
                                        Found in includes/skins/Skin.php - About 1 hr to fix

                                        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 initPage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function initPage( OutputPage $out ) {
                                                $skinMetaTags = $this->getConfig()->get( MainConfigNames::SkinMetaTags );
                                                $siteName = $this->getConfig()->get( MainConfigNames::Sitename );
                                                $this->preloadExistence();
                                        
                                        
                                        Severity: Minor
                                        Found in includes/skins/Skin.php - About 1 hr to fix

                                          Method getRelevantUser has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              public function getRelevantUser(): ?UserIdentity {
                                                  if ( $this->mRelevantUser === false ) {
                                                      $this->mRelevantUser = null; // false indicates we never attempted to load it.
                                                      $title = $this->getRelevantTitle();
                                                      if ( $title->hasSubjectNamespace( NS_USER ) ) {
                                          Severity: Minor
                                          Found in includes/skins/Skin.php - About 1 hr to fix

                                            Function normalizeKey has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public static function normalizeKey( string $key ) {
                                                    $config = MediaWikiServices::getInstance()->getMainConfig();
                                                    $defaultSkin = $config->get( MainConfigNames::DefaultSkin );
                                                    $fallbackSkin = $config->get( MainConfigNames::FallbackSkin );
                                                    $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
                                            Severity: Minor
                                            Found in includes/skins/Skin.php - About 35 mins to fix

                                            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 getCachedNotice has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                private function getCachedNotice( $name ) {
                                                    $config = $this->getConfig();
                                            
                                                    if ( $name === 'default' ) {
                                                        // special case
                                            Severity: Minor
                                            Found in includes/skins/Skin.php - About 35 mins to fix

                                            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

                                            Avoid too many return statements within this method.
                                            Open

                                                            return null;
                                            Severity: Major
                                            Found in includes/skins/Skin.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                      return Html::rawElement(
                                                          'div',
                                                          [
                                                              'class' => $name,
                                                              'lang' => $contLang->getHtmlCode(),
                                              Severity: Major
                                              Found in includes/skins/Skin.php - About 30 mins to fix

                                                There are no issues that match your filters.

                                                Category
                                                Status