jhuesser/bzu-jodel-clone

View on GitHub
functions/jodelmeta.php

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 5 of 6 total issues

Method jodelage has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function jodelage($postdate)
{
$now = date('Y-m-d H:i:s');
$now = date_create_from_format('Y-m-d H:i:s', $now);
$postdate = date_create_from_format('Y-m-d H:i:s', $postdate);
Severity: Minor
Found in functions/jodelmeta.php - About 1 hr to fix

Method deleteComment has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function deleteComment($commentID){
global $apiroot, $config, $baseurl;
//get uploaddir
$uploaddir = $config->image_upload_dir;
//get imageID of comment
Severity: Minor
Found in functions/jodelmeta.php - About 1 hr to fix

Function jodelage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function jodelage($postdate)
{
$now = date('Y-m-d H:i:s');
$now = date_create_from_format('Y-m-d H:i:s', $now);
$postdate = date_create_from_format('Y-m-d H:i:s', $postdate);
Severity: Minor
Found in functions/jodelmeta.php - About 1 hr to fix

Function deleteComment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function deleteComment($commentID){
global $apiroot, $config, $baseurl;
//get uploaddir
$uploaddir = $config->image_upload_dir;
//get imageID of comment
Severity: Minor
Found in functions/jodelmeta.php - About 25 mins to fix

Avoid unused local variables such as '$baseurl'.
Open

global $apiroot, $baseurl, $config;
Severity: Minor
Found in functions/jodelmeta.php by phpmd

Avoid variables with short names like $x. Configured minimum length is 3.
Wontfix

$x = FALSE;
Severity: Minor
Found in functions/jodelmeta.php by phpmd

There are no issues that match your filters.

Category
Status