Showing 110 of 127 total issues
Function photoSortSqlForOption
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function photoSortSqlForOption($option)
{
if ($option == 'newest') {
return 'value desc, photos.id desc';
} elseif ($option == 'oldest') {
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
echo <<<EOL
<!-- CAMERALIFE PHONE HOME Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-52764-13"></script>
- 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 handleRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function handleRequest($get, $post, $files, $cookies, $server)
Function tagSortSqlForOption
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function tagSortSqlForOption($option)
{
if ($option == 'newest') {
return 'albums.id desc';
} elseif ($option == 'oldest') {
- 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 handleGet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
if (Models\User::currentUser($cookies)->authorizationLevel < 5) {
throw new \Exception('You are not authorized to view this page');
}
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
echo "<h2>Site change logs</h2>";
echo "<p class=\"lead\">";
if ($this->checkpointId > 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 folderSortSqlForOption
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function folderSortSqlForOption($option)
{
if ($option == 'newest') {
return 'date desc';
} elseif ($option == 'oldest') {
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
echo "<h2>Site comments review</h2>";
echo "<p class=\"lead\">";
if ($this->checkpointId > 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 isCacheMissing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function isCacheMissing()
{
if ($this->record['modified'] == '1') {
return true; //legacy before 2.7
}
- 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 folderSortSqlForOption
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function folderSortSqlForOption($option)
{
if ($option == 'newest') {
return 'id desc';
} elseif ($option == 'oldest') {
- 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 'id desc';
Avoid too many return
statements within this method. Open
return array();
Avoid too many return
statements within this method. Open
return 'hits, photos.id';
Avoid too many return
statements within this method. Open
return 'photos.id desc';
Avoid too many return
statements within this method. Open
return 'albums.hits desc';
Avoid too many return
statements within this method. Open
return 'albums.hits';
Avoid too many return
statements within this method. Open
return 'hits desc';
Avoid too many return
statements within this method. Open
return 'hits';
Avoid too many return
statements within this method. Open
return 'hits desc';
Avoid too many return
statements within this method. Open
return 'id desc';