Function getPersonGuardianAllByToPersonList
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function getPersonGuardianAllByToPersonList($tblToPersonList)
{
$GuardianList = array();
if ($tblToPersonList && !empty($tblToPersonList)) {
- 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 Service.php
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\People\Relationship;
use SPHERE\Application\Corporation\Company\Company;
use SPHERE\Application\Corporation\Company\Service\Entity\TblCompany;
Service
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Service extends AbstractService
{
/**
* @return false|ViewRelationshipToPerson[]
Function checkFormRelationshipToPerson
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function checkFormRelationshipToPerson(
TblPerson $tblPerson,
$Type,
$To,
TblToPerson $tblToPerson = null,
- 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 checkGuardianRelationshipsForPerson
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function checkGuardianRelationshipsForPerson(TblPerson $tblPersonChild, TblPerson $tblPersonGuardian, $Ranking, $IsSingleParent)
{
$result = array();
if (($tblType = $this->getTypeByName(TblType::IDENTIFIER_GUARDIAN))
- 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 checkFormRelationshipToPerson
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkFormRelationshipToPerson(
TblPerson $tblPerson,
$Type,
$To,
TblToPerson $tblToPerson = null,
Method getPersonGuardianAllByToPersonList
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPersonGuardianAllByToPersonList($tblToPersonList)
{
$GuardianList = array();
if ($tblToPersonList && !empty($tblToPersonList)) {
Method checkFormRelationshipToCompany
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkFormRelationshipToCompany(
TblPerson $tblPerson,
$Type,
$To,
TblToCompany $tblToCompany = null,
Method checkFormRelationshipToPerson
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPerson $tblPerson,
$Type,
$To,
TblToPerson $tblToPerson = null,
$Search = ''
Method checkFormRelationshipToCompany
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPerson $tblPerson,
$Type,
$To,
TblToCompany $tblToCompany = null,
$Search = ''
Method insertRelationshipToPerson
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPerson $tblPersonFrom,
TblPerson $tblPersonTo,
TblType $tblType,
$Remark,
$Ranking = null
Function createRelationshipToPerson
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createRelationshipToPerson(
TblPerson $tblPersonFrom,
TblPerson $tblPersonTo,
$Type
) {
- 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 checkFormRelationshipToCompany
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function checkFormRelationshipToCompany(
TblPerson $tblPerson,
$Type,
$To,
TblToCompany $tblToCompany = null,
- 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 removeRelationshipAllByPerson
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function removeRelationshipAllByPerson(TblPerson $tblPerson, $IsSoftRemove = false)
{
if (($tblRelationshipToPersonList = $this->getPersonRelationshipAllByPerson($tblPerson))){
foreach($tblRelationshipToPersonList as $tblToPerson){
- 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"