Showing 110 of 127 total issues
Method generateThumbnail
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateThumbnail()
{
$this->loadImage(); // sets $this->EXIF and $this-record
if ($this->record['modified'] == '1') {
$this->record['modified'] = null; // legacy before 2.7
Method getRelated
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRelated()
{
//todo pass in referrer
global $_SERVER;
$retval = array($this->getFolder());
Method render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$start = $this->start;
$total = $this->total;
$perPage = $this->perPage;
Method render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$message = $this->exception->getMessage();
echo '<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">';
Method listFiles
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listFiles($path = '/', $recursive = true)
{
$fullpath = $this->baseDir . $path;
// FEATURE // add " NOCL" to the end of a folder to exclude it
Method render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
echo "<h2>Review New photos</h2>";
$percentDone = 0;
Method render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$gravitarHTML = htmlentities($this->currentUser->gravitarUrl());
?>
Function getMediaURL
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getMediaURL($scale = 'thumbnail')
{
$bucket = 'other';
$path = '';
if ($scale == 'photo') {
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
$start = isset($get['start']) ? $get['start'] : 0;
$section = isset($get['section']) ? $get['section'] : null;
$this->model->setPage($start);
- 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 render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
echo '<div>' . PHP_EOL;
foreach ($this->openGraphObjects as $view) {
$openGraphObject = $view;
Method loginWithAccessCode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function loginWithAccessCode($code)
{
// todo: breaks mvc
global $_SERVER;
$cookie = bin2hex(random_bytes(16));
Method getMediaURL
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMediaURL($scale = 'thumbnail')
{
$bucket = 'other';
$path = '';
if ($scale == 'photo') {
Method handleGet
has 34 lines of code (exceeds 25 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');
}
Method update
has 33 lines of code (exceeds 25 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();
Method handleGet
has 33 lines of code (exceeds 25 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');
}
Method getFileForPhotoWithScale
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getFileForPhotoWithScale(Models\Photo $photo, $scale)
{
$extension = $photo->extension;
$bucket = 'other';
$path = '';
Method handleGet
has 32 lines of code (exceeds 25 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;
Function handleRequest
has a Cognitive Complexity of 11 (exceeds 5 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();
- 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
Function render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
$message = $this->exception->getMessage();
echo '<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">';
- 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"