File IdPlist.php
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
Function listAllIdentityProviders
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function listAllIdentityProviders($activeOnly = 0, $country = "")
{
common\Entity::intoThePotatoes();
$handle = DBConnection::handle("INST");
$handle->exec("SET SESSION group_concat_max_len=10000");
- 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 listIdentityProvidersWithProfiles
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function listIdentityProvidersWithProfiles() {
$handle = DBConnection::handle("INST");
$handle->exec("SET SESSION group_concat_max_len=10000");
$idpQuery = IdPlist::setAllIdentyProvidersQuery(1);
$allIDPs = $handle->exec($idpQuery);
- 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 getIdpDistance
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private static function getIdpDistance($idp, $location)
{
$dist = 10000;
if (isset($idp['geo'])) {
$G = $idp['geo'];
- 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 listIdentityProvidersWithProfiles
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function listIdentityProvidersWithProfiles() {
$handle = DBConnection::handle("INST");
$handle->exec("SET SESSION group_concat_max_len=10000");
$idpQuery = IdPlist::setAllIdentyProvidersQuery(1);
$allIDPs = $handle->exec($idpQuery);
Method listAllIdentityProviders
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function listAllIdentityProviders($activeOnly = 0, $country = "")
{
common\Entity::intoThePotatoes();
$handle = DBConnection::handle("INST");
$handle->exec("SET SESSION group_concat_max_len=10000");
Method setProfileAttributes
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function setProfileAttributes($profile)
{
$profileOptions = explode('---', $profile->profile_options);
$productionProfile = false;
$profileNames = [];
Function setProfileAttributes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static function setProfileAttributes($profile)
{
$profileOptions = explode('---', $profile->profile_options);
$productionProfile = false;
$profileNames = [];
- 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 setIdentityProviderAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function setIdentityProviderAttributes($idp) {
$options = explode('---', $idp->options);
$names = [];
$geo = [];
$icon = 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"