Showing 2,096 of 2,096 total issues
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function run( $new, IContextSource $context, $summary ) {
$attemptSaveFilterStart = microtime( true );
$hookStatus = $this->hookRunner->run( $new, $context, $summary );
$attemptSaveFilterEnd = microtime( true );
- 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 processUnit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function processUnit( $unit ) {
$this->output( "Processing $unit...\n" );
$query = <<<QUERY
SELECT * WHERE {
{
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
//TODO: more validation for options
$shardingFactor = (int)$this->getOption( 'sharding-factor', 1 );
$shard = (int)$this->getOption( 'shard', 0 );
$batchSize = (int)$this->getOption( 'batch-size', 100 );
- 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 getUndoContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getUndoContent(
Content $latestContent,
Content $newerContent,
Content $olderContent,
$undoIsLatest = false
- 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 generateReferencesChangeOps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function generateReferencesChangeOps( Statement $fromStatement, Statement $toStatement ) {
$changeOps = new ChangeOps();
/** @var Reference $reference */
foreach ( $fromStatement->getReferences() as $reference ) {
- 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 addSecondaryCoordinates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function addSecondaryCoordinates(
CoordinatesOutput $coordinatesOutput,
$primaryCoordKey
) {
foreach ( $this->coordinates as $key => $coords ) {
- 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 reconvertOutputString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function reconvertOutputString( $value, Language $lang ) {
foreach ( self::PRECISION_MSG_KEYS as $precision => $msgKeysGroup ) {
foreach ( $msgKeysGroup as $msgKey ) {
$res = $this->parseFromOutputString(
$lang,
- 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 processSnak
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function processSnak( Snak $snak, PropertyId $propertyId, $rank ) {
$fileName = $this->getString( $snak );
if ( $fileName === null || $fileName === '' ) {
return;
}
- 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 processStatement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function processStatement( Statement $statement ) {
$propertyId = $statement->getPropertyId();
if ( $this->propertyDataTypeMatcher->isMatchingDataType(
$propertyId,
- 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 getMwDateFormatParser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getMwDateFormatParser(
$languageCode = 'en',
$dateFormatPreference = 'dmy',
$dateFormatType = 'date',
ParserOptions $options = null
- 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 validateTopLevelFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function validateTopLevelFields( array $property ): void {
if (
!is_string( $property['data_type'] ) ||
!in_array( $property['data_type'], $this->dataTypesArray )
) {
- 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 cleanTermInLangIdsInner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function cleanTermInLangIdsInner( array $termInLangIds ): void {
$this->logger->debug(
'{method}: deleting {count} term_in_lang rows',
[
'method' => __METHOD__,
- 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 getSetting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getSetting( $settingName ) {
if ( !$this->offsetExists( $settingName ) && !property_exists( $this, $settingName ) ) {
throw new OutOfBoundsException( 'Attempt to get non-existing setting "' . $settingName . '"' );
}
- 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 format
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function format( $conceptUri ) {
if ( !is_string( $conceptUri ) ) {
throw new InvalidArgumentException( '$conceptUri must be a string' );
}
- 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 getContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getContent( EntityId $entityId, $revision, $language, $editLink, TermLanguageFallbackChain $preferredLanguages ) {
try {
$request = $this->requestFactory->create(
$this->formatUrl( $entityId, $revision, $language, $editLink, $preferredLanguages ),
[ 'timeout' => $this->ssrServerTimeout ],
- 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 calendarNameNeeded
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function calendarNameNeeded( TimeValue $value ): bool {
// Do not care about possibly wrong calendar models with precision 10 years and more.
if ( $value->getPrecision() <= TimeValue::PRECISION_YEAR10 ) {
return false;
}
- 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 isPrefetched
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function isPrefetched(
EntityId $entityId,
array $termTypes,
array $languageCodes
): bool {
- 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 filterDisabledDataTypes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function filterDisabledDataTypes( array $dataTypeDefinitions, array $disabledTypes ) {
foreach ( $dataTypeDefinitions as $id => $def ) {
if ( strpos( $id, 'PT' ) === 0 ) {
if ( in_array( substr( $id, 3 ), $disabledTypes ) ) {
unset( $dataTypeDefinitions[$id] );
- 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 setKeys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function setKeys( array $entityIds, array $termTypes, array $languageCodes ): void {
foreach ( $entityIds as $entityId ) {
foreach ( $termTypes as $termType ) {
foreach ( $languageCodes as $languageCode ) {
$key = $this->getKey( $entityId, $termType, $languageCode );
- 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 getCallbackToAddDataTypeToSnaksGroupedByProperty
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getCallbackToAddDataTypeToSnaksGroupedByProperty(
PropertyDataTypeLookup $dataTypeLookup,
EntityIdParser $entityIdParser
) {
return function ( $array ) use ( $dataTypeLookup, $entityIdParser ) {
- 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"