Function streamThumb
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
protected function streamThumb( array $params ) {
$varyOnXFP = $this->getConfig( MainConfigNames::VaryOnXFP );
$headers = []; // HTTP headers to send
- 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 streamThumb
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function streamThumb( array $params ) {
$varyOnXFP = $this->getConfig( MainConfigNames::VaryOnXFP );
$headers = []; // HTTP headers to send
File ThumbnailEntryPoint.php
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Entry point implementation for retrieving media thumbnails, created by a MediaHandler
* subclass or proxy request if FileRepo::getThumbProxyUrl is configured.
*
Method generateThumbnail
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateThumbnail( File $file, array $params, $thumbName, $thumbPath ) {
$attemptFailureEpoch = $this->getConfig( MainConfigNames::AttemptFailureEpoch );
$cache = ObjectCache::getLocalClusterInstance();
$key = $cache->makeKey(
Method thumbError
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function thumbError( $status, $msgHtml, $msgText = null, $context = [] ) {
$showHostnames = $this->getConfig( MainConfigNames::ShowHostnames );
HeaderCallback::warnIfHeadersSent();
Function extractThumbParams
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function extractThumbParams( $file, $params ) {
if ( !isset( $params['thumbName'] ) ) {
throw new InvalidArgumentException( "No thumbnail name passed to extractThumbParams" );
}
- 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 generateThumbnail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function generateThumbnail( File $file, array $params, $thumbName, $thumbPath ) {
$attemptFailureEpoch = $this->getConfig( MainConfigNames::AttemptFailureEpoch );
$cache = ObjectCache::getLocalClusterInstance();
$key = $cache->makeKey(
- 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 thumbError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function thumbError( $status, $msgHtml, $msgText = null, $context = [] ) {
$showHostnames = $this->getConfig( MainConfigNames::ShowHostnames );
HeaderCallback::warnIfHeadersSent();
- 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;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return [ $thumb, $errorHtml ];
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;