Showing 691 of 718 total issues
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;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return Status::newGood();
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return [
Status::newFatal( 'cirrussearch-backend-error' ),
$formattedMessage
];
Avoid too many return
statements within this method. Open
return Status::newFatal( 'cirrussearch-failed-send-data' );
Avoid too many return
statements within this method. Open
return $error;