Showing 110 of 127 total issues
File Photo.php
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CameraLife\Models;
/**
* Class Photo provides a front end to working with photos
Method doUpgrade
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doUpgrade()
{
//Database::beginTransaction();
$sql = '
CREATE TABLE "albums" (
Function loadEXIF
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
private function loadEXIF($file)
{
$exif = @exif_read_data($file, 'IFD0', true);
if ($exif === false) {
return;
- 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 setupTables
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setupTables()
{
empty(self::$pdoConnection) && self::connect();
$prefix = self::$prefix;
Function listFiles
has a Cognitive Complexity of 32 (exceeds 5 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
- 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 29 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
echo "<h2>Settings for " . $this->moduleName . "</h2>\n";
if (isset($module->about)) {
echo "<p class=\"lead\">" . $module->about . "</p>\n";
- 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 loadEXIF
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadEXIF($file)
{
$exif = @exif_read_data($file, 'IFD0', true);
if ($exif === false) {
return;
Method handleGet
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
// todo, get PREV and NEXT links from photo and use meta prev/next in HTML theme header
$this->htmlBareHeader($cookies);
Method checkPrerequesites
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkPrerequesites()
{
global $_SERVER;
$prerequesitesAreMet = true;
Method render
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
if ($this->photo->get('status') != 0) {
echo '<p class="alert alert-danger lead"><strong>Notice:</strong> This photo is not publicly viewable</p>';
}
Photo
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Photo extends IndexedModel
{
public $record;
public $image;
Method render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
if (!count($this->openGraphsForTop)) {
?>
</div>
Method render
has 77 lines of code (exceeds 25 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>
File Database.php
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CameraLife\Models;
/**
* PDO wrapper implementation of the database class
Method handleGet
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
$nextInstaller = null;
if (!Models\Database::installedSchemaIsCorrectVersion()) {
$driver = Models\Database::driverName();
Function imagerotateRightAngle
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function imagerotateRightAngle($imgSrc, $angle)
{
// dimenstion of source image
$srcX = imagesx($imgSrc);
$srcY = imagesy($imgSrc);
- 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 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
//$counts = $this->statistics->getCounts();
$popularPhotos = $this->statistics->getPopularPhotos();
$popularAlbums = $this->statistics->getPopularTags();
Function findChangesOnDisk
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function findChangesOnDisk()
{
$retval = array();
$fileStore = FileStore::fileStoreWithName('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
Method handleGet
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleGet($get, $post, $files, $cookies)
{
if (file_exists('../../config.php')) {
throw new \Exception("Camera Life already appears to be set up, because modules/config.inc exists.");
}
Method render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
echo "<h2>Site change logs</h2>";
echo "<p class=\"lead\">";
if ($this->checkpointId > 0) {