wikimedia/mediawiki-core

View on GitHub
includes/editpage/IntroMessageBuilder.php

Summary

Maintainability
F
4 days
Test Coverage

File IntroMessageBuilder.php has 552 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace MediaWiki\EditPage;

use LogEventsList;
Severity: Major
Found in includes/editpage/IntroMessageBuilder.php - About 1 day to fix

    Method addCodeEditingIntro has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function addCodeEditingIntro(
            IntroMessageList $messages,
            MessageLocalizer $localizer,
            Title $title,
            Authority $performer
    Severity: Major
    Found in includes/editpage/IntroMessageBuilder.php - About 2 hrs to fix

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

          private function addCodeEditingIntro(
              IntroMessageList $messages,
              MessageLocalizer $localizer,
              Title $title,
              Authority $performer
      Severity: Minor
      Found in includes/editpage/IntroMessageBuilder.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 addUserWarnings has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function addUserWarnings(
              IntroMessageList $messages,
              MessageLocalizer $localizer,
              Title $title,
              Authority $performer
      Severity: Major
      Found in includes/editpage/IntroMessageBuilder.php - About 2 hrs to fix

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

            private function addUserConfigPageInfo(
                IntroMessageList $messages,
                MessageLocalizer $localizer,
                Title $title,
                Authority $performer,
        Severity: Minor
        Found in includes/editpage/IntroMessageBuilder.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 addPageProtectionWarningHeaders has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function addPageProtectionWarningHeaders(
                IntroMessageList $messages,
                MessageLocalizer $localizer,
                ProperPageIdentity $page
            ): void {
        Severity: Minor
        Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

          Method __construct has 14 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  Config $config,
                  LinkRenderer $linkRenderer,
                  PermissionManager $permManager,
                  UserNameUtils $userNameUtils,
                  TempUserCreator $tempUserCreator,
          Severity: Major
          Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

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

                private function addSharedRepoHint(
                    IntroMessageList $messages,
                    MessageLocalizer $localizer,
                    ProperPageIdentity $page
                ): void {
            Severity: Minor
            Found in includes/editpage/IntroMessageBuilder.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 addEditIntro has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function addEditIntro(
                    IntroMessageList $messages,
                    MessageLocalizer $localizer,
                    ProperPageIdentity $page,
                    Authority $performer,
            Severity: Minor
            Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

              Method getIntroMessages has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      int $frames,
                      array $skip,
                      MessageLocalizer $localizer,
                      ProperPageIdentity $page,
                      ?RevisionRecord $revRecord,
              Severity: Major
              Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

                Method addUserConfigPageInfo has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function addUserConfigPageInfo(
                        IntroMessageList $messages,
                        MessageLocalizer $localizer,
                        Title $title,
                        Authority $performer,
                Severity: Minor
                Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

                  Method addSharedRepoHint has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function addSharedRepoHint(
                          IntroMessageList $messages,
                          MessageLocalizer $localizer,
                          ProperPageIdentity $page
                      ): void {
                  Severity: Minor
                  Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

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

                        private function addEditIntro(
                            IntroMessageList $messages,
                            MessageLocalizer $localizer,
                            ProperPageIdentity $page,
                            Authority $performer,
                    Severity: Minor
                    Found in includes/editpage/IntroMessageBuilder.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 addAnonEditWarning has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function addAnonEditWarning(
                            IntroMessageList $messages,
                            MessageLocalizer $localizer,
                            Title $title,
                            Authority $performer,
                    Severity: Minor
                    Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

                      Function addPageProtectionWarningHeaders has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function addPageProtectionWarningHeaders(
                              IntroMessageList $messages,
                              MessageLocalizer $localizer,
                              ProperPageIdentity $page
                          ): void {
                      Severity: Minor
                      Found in includes/editpage/IntroMessageBuilder.php - About 55 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 addUserWarnings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function addUserWarnings(
                              IntroMessageList $messages,
                              MessageLocalizer $localizer,
                              Title $title,
                              Authority $performer
                      Severity: Minor
                      Found in includes/editpage/IntroMessageBuilder.php - About 55 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

                      Method addEditIntro has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              IntroMessageList $messages,
                              MessageLocalizer $localizer,
                              ProperPageIdentity $page,
                              Authority $performer,
                              ?string $editIntro,
                      Severity: Minor
                      Found in includes/editpage/IntroMessageBuilder.php - About 45 mins to fix

                        Method addAnonEditWarning has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                IntroMessageList $messages,
                                MessageLocalizer $localizer,
                                Title $title,
                                Authority $performer,
                                ?string $returnToQuery,
                        Severity: Minor
                        Found in includes/editpage/IntroMessageBuilder.php - About 45 mins to fix

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

                                  IntroMessageList $messages,
                                  MessageLocalizer $localizer,
                                  Title $title,
                                  Authority $performer,
                                  bool $preview
                          Severity: Minor
                          Found in includes/editpage/IntroMessageBuilder.php - About 35 mins to fix

                            Function addEditNotices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function addEditNotices(
                                    IntroMessageList $messages,
                                    MessageLocalizer $localizer,
                                    Title $title,
                                    ?RevisionRecord $revRecord
                            Severity: Minor
                            Found in includes/editpage/IntroMessageBuilder.php - About 25 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

                            There are no issues that match your filters.

                            Category
                            Status