Showing 718 of 718 total issues
Function overrideNumeric
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function overrideNumeric( &$dest, $request, $name, $limit = null, $upperLimit = true ) {
$val = $request->getVal( $name );
if ( $val !== null && is_numeric( $val ) ) {
if ( $limit === null ) {
$dest = $val;
- 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 nextToken
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function nextToken() {
Assert::precondition( $this->token->getStart() < $this->offset,
'You should not call nextToken() twice on the same offsets' );
$this->token->copyTo( $this->lookBehind );
$this->token->reset();
- 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 visitBooleanClause
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function visitBooleanClause( BooleanClause $clause ) {
if ( $clause->isExplicit() ) {
$this->isComplex = true;
}
$oldNegated = $this->inNegation;
- 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 classify
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function classify( ParsedQuery $query ) {
$this->hasWords = false;
$this->hasSimplePhrase = false;
$this->hasComplex = false;
$this->depth = 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 execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $wgLanguageCode,
$wgCirrusSearchBannedPlugins,
$wgCirrusSearchMasterTimeout;
- 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 build_config
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_config(parallelism: int) -> Sequence[ClusterToCheck]:
with ThreadPoolExecutor(max_workers=parallelism) as executor:
wiki_state = list(make_all_wiki_state(executor))
accept_all = [
- 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 wrapDecodeResults
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function wrapDecodeResults( BatchRowIterator $it, $endingAtColumn ) {
return new CallbackIterator( $it, function ( $batch ) use ( $endingAtColumn ) {
// Build the updater outside the loop because it stores the redirects it hits.
// Don't build it at the top level so those are stored when it is freed.
$updater = $this->createUpdater();
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$this->validateParams();
foreach ( $this->getPageIdentities() as $pageIdentity ) {
$tagPrefix = $this->getOption( 'tagType' );
$cirrusSearch = new CirrusSearch();
- 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 getJobInfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getJobInfo( $jobName ) {
$latest = null;
// Fetch the lastest jobInfo from the metastore. Ideally all
// jobInfo should be the same but in the case a cluster has
// been decommissioned and re-added its job info may be outdated
- 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 validate_clusters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_clusters(clusters: Sequence[ClusterToCheck]) -> Sequence[Problem]:
clusters = list(clusters)
es_states = {
cluster.key: make_elasticsearch_state(cluster)
for cluster in clusters}
- 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 listen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def listen(wiki, q):
while True:
try:
error = q.get()
if error is None:
- 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 buildChunks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function buildChunks( $buildChunks ) {
$dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
if ( $this->toId === null ) {
$this->toId = $dbr->newSelectQueryBuilder()
->select( 'MAX(page_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
Avoid too many return
statements within this method. Open
return [ $status, 'Regex syntax error: ' . $syntaxError ];
Avoid too many return
statements within this method. Open
return [ null, $redirects ];
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return [ $pageId, $hasRedirects ];
Avoid too many return
statements within this method. Open
return (string)( $d->getId() );
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $requestEvent;
Avoid too many return
statements within this method. Open
return true;