Showing 1,432 of 2,096 total issues
Method getRankedSearchResults
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$text,
$languageCode,
$entityType,
$limit,
$strictLanguage,
Method onHtmlPageLinkRendererEnd
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$linkRenderer,
$target,
$isKnown,
&$text,
&$extraAttribs,
Method getRankedSearchResults
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$text,
$languageCode,
$entityType,
$limit,
$strictLanguage,
Method getRankedSearchResults
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$text,
$languageCode,
$entityType,
$limit,
$strictLanguage,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $mainModule,
string $moduleName,
ItemMergeInteractor $interactor,
ApiErrorReporter $errorReporter,
callable $resultBuilderInstantiator,
Method getRankedSearchResults
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$text,
$languageCode,
$entityType,
$limit,
$strictLanguage,
Function onRevisionFromEditComplete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function onRevisionFromEditComplete(
WikiPage $wikiPage,
RevisionRecord $revisionRecord,
$baseID,
UserIdentity $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"
Further reading
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$maxLength,
array $languageCodes,
EntityIdParser $idParser,
TermsCollisionDetectorFactory $termsCollisionDetectorFactory,
TermLookup $termLookup,
Method factory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $apiMain,
string $moduleName,
IBufferingStatsdDataFactory $dataFactory,
ApiHelperFactory $apiHelperFactory,
EntityIdFormatterFactory $entityIdFormatterFactory,
Method factory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $mainModule,
string $moduleName,
ApiHelperFactory $apiHelperFactory,
EntityIdParser $entityIdParser,
StatementGuidParser $statementGuidParser,
Method searchEntities
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function searchEntities( $text, $languageCode, $entityType, $limit, $prefixSearch, $strictLanguage ) {
Method addValueNode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
RdfWriter $writer,
$propertyValueNamespace,
$propertyValueLName,
$dataType,
$snakNamespace,
Method addValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
RdfWriter $writer,
$propertyValueNamespace,
$propertyValueLName,
$dataType,
$snakNamespace,
Function validateSiteLinkSerialization
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function validateSiteLinkSerialization( $serialization, $siteCode, SiteList $sites = null ) {
$this->assertArray( $serialization, 'An array was expected, but not found' );
if ( !array_key_exists( 'site', $serialization ) ) {
throw new ChangeOpDeserializationException( 'Site must be provided', 'no-site' );
- 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 addValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
RdfWriter $writer,
$propertyValueNamespace,
$propertyValueLName,
$dataType,
$snakNamespace,
Method addValueNode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
RdfWriter $writer,
$propertyValueNamespace,
$propertyValueLName,
$dataType,
$snakNamespace,
Method addValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
RdfWriter $writer,
$propertyValueNamespace,
$propertyValueLName,
$dataType,
$snakNamespace,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Statement $statement,
GuidGenerator $guidGenerator,
StatementGuidValidator $guidValidator,
StatementGuidParser $guidParser,
SnakValidator $snakValidator,
Method attemptSave
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityDocument $newEntity,
string $summary,
$flags,
$token,
$watch = null,
Function addLabels
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addLabels( $entityNamespace, $entityLName, TermList $labels, array $labelPredicates ) {
if ( !$labelPredicates ) {
// If we want no predicates, no need to bother with the rest.
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"