Showing 251 of 1,173 total issues
Method getServer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getServer($key)
{
switch ($key) {
case 'SERVER_NAME':
$info = filter_input(INPUT_SERVER, 'SERVER_NAME', FILTER_SANITIZE_STRING);
Method getAllLoggedIn
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAllLoggedIn(array $whiteList = null)
{
if (!isset($_SESSION['loggedIn']) || empty($_SESSION['loggedIn']) || !is_array($_SESSION['loggedIn'])) {
return false;
}
Method testGetTableNameByClassName
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testGetTableNameByClassName()
{
$stateMapper = new StateMapper();
$inputOutputs = [
Method testRemoveSuffix
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testRemoveSuffix()
{
$utility = new StringUtility();
$inputOutputs = [
Method testUpdateQuery
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testUpdateQuery()
{
$queryMaker = new \CodeJetter\core\database\QueryMaker('testTable');
$criteria = [
Method getInputs
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getInputs(array $inputKeys = [], $requestMethod = null)
{
if (isset($this->inputs)) {
return $this->inputs;
}
Method getAccessRole
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getAccessRole($urlPath, $roles = [])
{
if (empty($roles)) {
$roles = Registry::getConfigClass()->get('roles');
}
Method testLogin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testLogin()
{
$app = App::getInstance();
$app->init('dev');
Method getPersonalizedMenu
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPersonalizedMenu()
{
$routeInfo = Registry::getRouterClass()->getLastRoute();
if (!$routeInfo instanceof RouteInfo) {
Method generateCheckboxes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function generateCheckboxes($options, $name = null, $checked = null, array $configs = [])
{
$html = '';
$name = ($name !== null) ? " name='{$name}'" : '';
Method getSelectFromTables
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getSelectFromTables($fromColumns = null)
{
$joinedSelect = [];
$counter = 1;
$from = '';
Function getDefinedInputs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getDefinedInputs($action = null, array $includingInputs = [], array $excludingInputs = [])
{
if ($action === 'batchUpdate') {
$idRule = new ValidatorRule('id');
$definedInputs['id'] = new DatabaseInput('id', [$idRule]);
- 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 __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$routeType,
$requestMethod,
$url,
$component,
$controller,
Method generateConfirmationModal
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$divId,
$labelId,
$modalTitlePrefix,
FormHandler $formHandler,
$formClass,
Method login
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function login(User $user, $password)
{
$output = new Output();
$userModel = $user->getClassNameFromNamespace();
Function applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
Method add
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function add(array $inputs, array $fieldsValues = [], $extraDefinedInputs = [])
{
/**
* Start validating.
*/
Method logMessage
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function logMessage($level, $message, $context = [])
{
if ($this->getConfigs()['inOperation'] !== true) {
return false;
}
Function appendDataObjectToForm
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function appendDataObjectToForm(data, form, whitelist)
{
if (typeof data != "undefined" && typeof form != "undefined") {
var foundDiv = $(form).find('.appended-data');
Method safeDeleteChild
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function safeDeleteChild()
{
$inputs = (new Request('POST'))->getInputs();
if (empty($inputs['id'])) {