Showing 251 of 1,173 total issues
Method testPluralToSingular
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testPluralToSingular()
{
$utility = new StringUtility();
$inputOutputs = [
Method testSingularToPlural
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testSingularToPlural()
{
$utility = new StringUtility();
$inputOutputs = [
Function bindCriteria
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function bindCriteria(\PDOStatement $statement, array $criteria)
{
// bind criteria values
if (!empty($criteria)) {
$counter = 0;
- 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 testGetFieldsValues
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetFieldsValues()
{
$utility = new InputUtility();
$requiredRule = new ValidatorRule('required');
Function authorizeRoute
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function authorizeRoute($accessRole, $rootNamespace, $component, $controller, $redirect = true)
{
$roles = Registry::getConfigClass()->get('roles');
$redirections = Registry::getConfigClass()->get('redirections');
- 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
File BaseMapperTest.php
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter\tests;
use CodeJetter\components\geolocation\mappers\StateMapper;
Function getAllLoggedIn
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getAllLoggedIn(array $whiteList = null)
{
if (!isset($_SESSION['loggedIn']) || empty($_SESSION['loggedIn']) || !is_array($_SESSION['loggedIn'])) {
return false;
}
- 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 update
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function update(
array $criteria,
array $inputs,
array $fieldsValues,
$limit = 0,
- 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 batchBindValues
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function batchBindValues(
\PDOStatement $statement,
array $criteria,
$start = 0,
$limit = 0,
- 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
File UserMapper.php
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter\components\user\mappers;
use CodeJetter\components\user\models\User;
File Routes.Template.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter;
class RoutesTemplate
Method testValidateURL
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateURL()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateMoney
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateMoney()
{
$app = App::getInstance();
$app->init('dev');
Method checkURL
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkURL($url, array $options = [])
{
if (empty($url)) {
throw new \Exception('URL is empty');
}
File script.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
$(document).ready(function(){
toastr.options = {
"closeButton": true,
"progressBar": true,
"preventDuplicates": true,
File MemberUserMapper.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter\components\user\mappers;
use CodeJetter\components\user\models\MemberUser;
Function appendDataObjectToForm
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function appendDataObjectToForm(data, form, whitelist)
{
if (typeof data != "undefined" && typeof form != "undefined") {
var foundDiv = $(form).find('.appended-data');
- 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 getRouteInfo
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getRouteInfo($urlPath, $requestMethod)
{
if (empty($requestMethod)) {
return false;
}
- 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
File Router.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter\core;
use CodeJetter\components\page\models\MetaTag;
File RouterTest.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter\tests;
use CodeJetter\core\App;