Showing 110 of 127 total issues
Function getFileForPhotoWithScale
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static function getFileForPhotoWithScale(Models\Photo $photo, $scale)
{
$extension = $photo->extension;
$bucket = 'other';
$path = '';
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
$photoCount = $this->model->getPhotoCount();
$folderCount = $this->model->getFolderCount();
$albumCount = $this->model->getTagCount();
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
if (!count($this->openGraphsForTop)) {
?>
</div>
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
$photo = Models\Photo::getPhotoWithID($get['id']);
$scale = isset($get['scale']) ? $get['scale'] : null;
$extension = $photo->extension;
- 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 getDefaultForRecordTypeAndValueField
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getDefaultForRecordTypeAndValueField($recordType, $valueField)
{
switch ($recordType . '_' . $valueField) {
case 'photo_description':
$oldvalue = 'unnamed';
Method getFunFacts
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFunFacts()
{
if (empty($this->counts)) {
$this->getCounts();
}
Method render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
?>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
Function setupTables
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function setupTables()
{
empty(self::$pdoConnection) && self::connect();
$prefix = self::$prefix;
- 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 handlePost
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handlePost($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
Method imagerotateRightAngle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function imagerotateRightAngle($imgSrc, $angle)
{
// dimenstion of source image
$srcX = imagesx($imgSrc);
$srcY = imagesy($imgSrc);
Method handleRequest
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function handleRequest($get, $post, $files, $cookies, $server)
{
try {
$page = isset($get['page']) ? $get['page'] : 'mainPage';
$dbIsCurrent = Models\Database::installedSchemaIsCorrectVersion();
Function handleGet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
$this->htmlHeader($cookies);
/* Set up the page view */
- 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 select
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function select($table, $selection = '*', $condition = '1', $extra = '', $joins = '', $bind = array())
{
empty(self::$pdoConnection) && self::connect();
if (!$condition) {
$condition = '1';
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
$this->htmlHeader($cookies);
/* Set up the page view */
- 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 getDefaultForRecordTypeAndValueField
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static function getDefaultForRecordTypeAndValueField($recordType, $valueField)
{
switch ($recordType . '_' . $valueField) {
case 'photo_description':
$oldvalue = 'unnamed';
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function update()
{
//TODO: NEED TEST CASES FOR THIS AND ACTUAL TESTING!!!!!!!
// move files / delete files / readd files (undelete) / UTF filenames
$retval = array();
- 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 createAuditTrailForChange
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function createAuditTrailForChange(User $user, $record_type, $record_id, $value_field, $value_old, $value_new)
Method selectOne
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function selectOne($table, $selection = '*', $condition = '1', $extra = '', $joins = '', $bind = array())
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"