Function execute
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
public function execute( array $messages ): bool {
$context = RequestContext::getMain();
$output = $context->getOutput();
// Set up diff engine
- 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 execute
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( array $messages ): bool {
$context = RequestContext::getMain();
$output = $context->getOutput();
// Set up diff engine
File MessageWebImporter.php
has 402 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Synchronization;
MessageWebImporter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class MessageWebImporter {
private Title $title;
private User $user;
private MessageGroup $group;
private string $code;
Method doFuzzy
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function doFuzzy(
Title $title,
string $message,
string $comment,
?User $user
Function doAction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function doAction(
string $action,
MessageGroup $group,
string $key,
string $message
- 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 doFuzzy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function doFuzzy(
Title $title,
string $message,
string $comment,
?User $user
- 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"