wikimedia/mediawiki-core

View on GitHub
includes/parser/CoreMagicVariables.php

Summary

Maintainability
F
3 days
Test Coverage

Method expand has 182 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function expand(
        // Fundamental options
        Parser $parser,
        string $id,
        // Context passed over from the parser
Severity: Major
Found in includes/parser/CoreMagicVariables.php - About 7 hrs to fix

    Method expand has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            Parser $parser,
            string $id,
            // Context passed over from the parser
            ConvertibleTimestamp $ts,
            ServiceOptions $svcOptions,
    Severity: Minor
    Found in includes/parser/CoreMagicVariables.php - About 35 mins to fix

      Avoid too many return statements within this method.
      Open

                      return $pageLang->formatNumNoSeparators( $localTs->format( 'H' ) );
      Severity: Major
      Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return $pageLang->getMonthNameGen( (int)$ts->format( 'n' ) );
        Severity: Major
        Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $pageLang->formatNumNoSeparators( $localTs->format( 'j' ) );
          Severity: Major
          Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return $pageLang->formatNumNoSeparators( $ts->format( 'd' ) );
            Severity: Major
            Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return (string)$svcOptions->get( MainConfigNames::ScriptPath );
              Severity: Major
              Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return (string)$svcOptions->get( MainConfigNames::StylePath );
                Severity: Major
                Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $pageLang->getMonthNameGen( (int)$localTs->format( 'n' ) );
                  Severity: Major
                  Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return CoreParserFunctions::$id( $parser, null );
                    Severity: Major
                    Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return $pageLang->formatNumNoSeparators( $localTs->format( 'Y' ) );
                      Severity: Major
                      Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return (string)$svcOptions->get( MainConfigNames::Sitename );
                        Severity: Major
                        Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return $parser->getContentLanguage()->getCode();
                          Severity: Major
                          Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return $pageLang->formatNum( $localTs->format( 'w' ) );
                            Severity: Major
                            Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return $pageLang->getWeekdayName( (int)$ts->format( 'w' ) + 1 );
                              Severity: Major
                              Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return $localTs->format( 'YmdHis' );
                                Severity: Major
                                Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return SpecialVersion::getVersion();
                                  Severity: Major
                                  Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return $pageLang->formatNumNoSeparators( $localTs->format( 'm' ) );
                                    Severity: Major
                                    Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                      return $pageLang->formatNumNoSeparators( $ts->format( 'Y' ) );
                                      Severity: Major
                                      Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                        return $pageLang->formatNumNoSeparators( $ts->format( 'j' ) );
                                        Severity: Major
                                        Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                          return $pageLang->formatNum( (int)$ts->format( 'W' ) );
                                          Severity: Major
                                          Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                            return $pageLang->getDirMark();
                                            Severity: Major
                                            Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                              return $pageLang->getMonthAbbreviation( (int)$localTs->format( 'n' ) );
                                              Severity: Major
                                              Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                return $pageLang->time(
                                                                    $localTs->format( 'YmdHis' ),
                                                                    false,
                                                                    false
                                                                );
                                                Severity: Major
                                                Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                  return $ts->getTimestamp( TS_MW );
                                                  Severity: Major
                                                  Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                    return $pageLang->getMonthName( (int)$localTs->format( 'n' ) );
                                                    Severity: Major
                                                    Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                      return $pageLang->formatNum( $ts->format( 'w' ) );
                                                      Severity: Major
                                                      Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                        return CoreParserFunctions::$id( $parser, null );
                                                        Severity: Major
                                                        Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

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

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                            return $pageLang->getMonthAbbreviation( (int)$ts->format( 'n' ) );
                                                            Severity: Major
                                                            Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                              return $pageLang->formatNumNoSeparators( $localTs->format( 'n' ) );
                                                              Severity: Major
                                                              Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                                return (string)$svcOptions->get( MainConfigNames::ArticlePath );
                                                                Severity: Major
                                                                Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                                  return (string)$svcOptions->get( MainConfigNames::Server );
                                                                  Severity: Major
                                                                  Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                    return $pageLang->getMonthName( (int)$ts->format( 'n' ) );
                                                                    Severity: Major
                                                                    Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                      return $pageLang->formatNumNoSeparators( $localTs->format( 'd' ) );
                                                                      Severity: Major
                                                                      Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                        return (string)$parser->getRevisionSize();
                                                                        Severity: Major
                                                                        Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                          return $pageLang->time( $ts->getTimestamp( TS_MW ), false, false );
                                                                          Severity: Major
                                                                          Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                            return $pageLang->formatNumNoSeparators( $ts->format( 'H' ) );
                                                                            Severity: Major
                                                                            Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                              return $pageLang->formatNum( (int)$localTs->format( 'W' ) );
                                                                              Severity: Major
                                                                              Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                return $pageLang->getWeekdayName( (int)$localTs->format( 'w' ) + 1 );
                                                                                Severity: Major
                                                                                Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                                  return (string)$svcOptions->get( MainConfigNames::ServerName );
                                                                                  Severity: Major
                                                                                  Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                    return $pageLang->getCode();
                                                                                    Severity: Major
                                                                                    Found in includes/parser/CoreMagicVariables.php - About 30 mins to fix

                                                                                      There are no issues that match your filters.

                                                                                      Category
                                                                                      Status