Showing 251 of 1,173 total issues
Method listMembers
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function listMembers()
{
// for pagination - for simple router url path is enough, for regex ones base path is needed
$pager = new Pager($this->getURLParameters(), $this->getBasePath(), $this->getRouteInfo()->getUrl());
Method update
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update(
array $criteria,
array $inputs,
array $fieldsValues,
$limit = 0,
File ErrorHandler.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace CodeJetter\core;
use Monolog\Formatter\LineFormatter;
Method getRouteInfo
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getRouteInfo($urlPath, $requestMethod)
{
if (empty($requestMethod)) {
return false;
}
Method viewChild
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function viewChild()
{
$urlParameters = $this->getURLParameters();
if (empty($urlParameters['id'])) {
View
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class View extends Base
{
private $config;
private $master;
private $header;
Method listGroups
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function listGroups()
{
// for pagination
// for simple router url path is enough, for regex ones base path is needed
$pager = new Pager($this->getURLParameters(), $this->getBasePath(), $this->getRouteInfo()->getUrl());
Method safeBatchDeleteChild
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function safeBatchDeleteChild()
{
$inputs = (new Request('POST'))->getInputs();
/**
QueryMaker
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class QueryMaker
{
private $tables;
private $validComparisonOperators = ['LIKE', 'NOT LIKE', '=', '!=', '<>', '<', '<=', '>', '>=', '<=>', 'IS NOT',
'IS', 'IS NOT NULL', 'IS NULL', 'IN', 'NOT IN', ];
Method testRemoveTablePrefixAndSuffix
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testRemoveTablePrefixAndSuffix()
{
$stateMapper = new StateMapper();
$inputOutputs = [
Function show
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
Method testGetTableAlias
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testGetTableAlias()
{
$stateMapper = new StateMapper();
$inputOutputs = [
Method testValidateEmail
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testValidateEmail()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateWhiteList
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testValidateWhiteList()
{
$app = App::getInstance();
$app->init('dev');
Function filter
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
public function filter(array $array, array $excludingElements, $filterBy = 'key')
{
if (empty($excludingElements)) {
return $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
Method deleteChildById
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function deleteChildById($childId, $safeDelete = true, MemberUser $userMember = null)
{
if ($userMember === null) {
$userMember = (new MemberUser())->getLoggedIn();
}
Method viewMember
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function viewMember()
{
$urlParameters = $this->getURLParameters();
if (empty($urlParameters['id'])) {
Method testValidateNumber
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testValidateNumber()
{
$app = App::getInstance();
$app->init('dev');
Method testGetClassNameByTableName
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testGetClassNameByTableName()
{
$stateMapper = new StateMapper();
$inputOutputs = [
Method listMessages
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function listMessages()
{
// for pagination
// for simple router url path is enough, for regex ones base path is needed
$pager = new Pager($this->getURLParameters(), $this->getBasePath(), $this->getRouteInfo()->getUrl());