repo/includes/Store/Sql/WikiPageEntityStore.php
File WikiPageEntityStore.php
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Wikibase\Repo\Store\Sql;
use InvalidArgumentException;
Method saveEntityContent
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function saveEntityContent(
EntityContent $entityContent,
User $user,
$summary = '',
$flags = 0,
Method __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
EntityContentFactory $contentFactory,
EntityTitleStoreLookup $entityTitleStoreLookup,
IdGenerator $idGenerator,
EntityIdComposer $entityIdComposer,
RevisionStore $revisionStore,
Function saveEntityContent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
private function saveEntityContent(
EntityContent $entityContent,
User $user,
$summary = '',
$flags = 0,
- 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 adjustFlagsForMCR
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
private function adjustFlagsForMCR( $flags, $parentRevision, $slotRole ) {
if ( $flags & EDIT_UPDATE ) {
if ( !$parentRevision ) {
throw new StorageException( 'Can\'t perform an update with no parent revision' );
}
- 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 saveEntityContent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
EntityContent $entityContent,
User $user,
$summary = '',
$flags = 0,
$baseRevId = false,
Method saveRedirect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
EntityRedirect $redirect,
$summary,
User $user,
$flags = 0,
$baseRevId = false,
Method saveEntity
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
EntityDocument $entity,
$summary,
User $user,
$flags = 0,
$baseRevId = false,