File IntroMessageBuilder.php
has 552 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\EditPage;
use LogEventsList;
Method addCodeEditingIntro
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addCodeEditingIntro(
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer
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
- 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 addUserWarnings
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addUserWarnings(
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer
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,
- 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 addPageProtectionWarningHeaders
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addPageProtectionWarningHeaders(
IntroMessageList $messages,
MessageLocalizer $localizer,
ProperPageIdentity $page
): void {
Method __construct
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Config $config,
LinkRenderer $linkRenderer,
PermissionManager $permManager,
UserNameUtils $userNameUtils,
TempUserCreator $tempUserCreator,
Function addSharedRepoHint
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function addSharedRepoHint(
IntroMessageList $messages,
MessageLocalizer $localizer,
ProperPageIdentity $page
): void {
- 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 addEditIntro
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addEditIntro(
IntroMessageList $messages,
MessageLocalizer $localizer,
ProperPageIdentity $page,
Authority $performer,
Method getIntroMessages
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
int $frames,
array $skip,
MessageLocalizer $localizer,
ProperPageIdentity $page,
?RevisionRecord $revRecord,
Method addUserConfigPageInfo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addUserConfigPageInfo(
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer,
Method addSharedRepoHint
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addSharedRepoHint(
IntroMessageList $messages,
MessageLocalizer $localizer,
ProperPageIdentity $page
): void {
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,
- 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 addAnonEditWarning
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addAnonEditWarning(
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer,
Function addPageProtectionWarningHeaders
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function addPageProtectionWarningHeaders(
IntroMessageList $messages,
MessageLocalizer $localizer,
ProperPageIdentity $page
): void {
- 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 addUserWarnings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function addUserWarnings(
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer
- 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 addEditIntro
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IntroMessageList $messages,
MessageLocalizer $localizer,
ProperPageIdentity $page,
Authority $performer,
?string $editIntro,
Method addAnonEditWarning
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer,
?string $returnToQuery,
Method addUserConfigPageInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer,
bool $preview
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
- 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"