Showing 251 of 1,173 total issues
Method getOneByEmail
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOneByEmail($email, $parentId = null, $status = null, $excludeArchived = true)
{
/*
* start validating
*/
Method add
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add(array $inputs, array $fieldsValues = [], $extraDefinedInputs = [])
{
/**
* Start validating common inputs.
*/
File HtmlUtilityTest.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter\tests;
use CodeJetter\core\utility\HtmlUtility;
Method testJsonToArray
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testJsonToArray()
{
$utility = new StringUtility();
$inputOutputs = [
Method route
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function route()
{
// get request method and URI
$request = new Request();
$requestMethod = $request->getRequestMethod();
Method authorizeRoute
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function authorizeRoute($accessRole, $rootNamespace, $component, $controller, $redirect = true)
{
$roles = Registry::getConfigClass()->get('roles');
$redirections = Registry::getConfigClass()->get('redirections');
Method checkTokenIsValidByEmail
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkTokenIsValidByEmail($email, $token)
{
$output = new Output();
/**
Method safeBatchDeleteMember
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeBatchDeleteMember()
{
$inputs = (new Request('POST'))->getInputs();
/**
Method testDiffInFullDays
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testDiffInFullDays()
{
$utility = new DateTimeUtility();
$ios = [
Function update
has a Cognitive Complexity of 15 (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 isInBlacklist
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function isInBlacklist($errorMessage, $errorFile)
{
$configs = $this->getConfigs();
if ($configs['blacklist']['inOperation'] !== true) {
- 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 getFilteredInputs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getFilteredInputs()
{
if (!isset($this->filteredInputs)) {
$this->filteredInputs = [];
if (!empty($this->getDefinedInputs())) {
- 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 generateSearchCriteria
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function generateSearchCriteria(array $listHeaders, $query = null, $requestMethod = 'GET')
{
if ($query === null) {
$config = Registry::getConfigClass();
$queryKey = $config->get('list')['query'];
- 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 testGenerateRadioButtons
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGenerateRadioButtons()
{
$utility = new HtmlUtility();
$ios = [
Method getStatesCities
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStatesCities(
array $criteria = [],
$fromColumns = null,
$order = null,
$start = 0,
Method getOneByEmail
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOneByEmail($email, $parentId = null, $status = null)
{
/**
* start validating.
*/
Method testFilter
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testFilter()
{
$utility = new ArrayUtility();
$ios = [
Method safeBatchDeleteGroup
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeBatchDeleteGroup()
{
$inputs = (new Request('POST'))->getInputs();
/**
Method resetPassword
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resetPassword(User $user, $token, $password, $passwordConfirmation)
{
$output = new Output();
/**
* Start validating passwords - email & resetPasswordToken are already validated.
Method testArrayComparison
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testArrayComparison()
{
$utility = new ArrayUtility();
$ios = [