Showing 529 of 599 total issues
Method eapBlock
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function eapBlock($eapType)
{
$realm = $this->determineOuterIdString();
$retval = "<key>EAPClientConfiguration</key>
<dict>
Method postProcessValidAttributes
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function postProcessValidAttributes(array $options, array &$good, array &$bad) {
foreach ($options as $index => $iterateOption) {
foreach ($iterateOption as $name => $optionPayload) {
switch ($name) {
case "eap:ca_url": // eap:ca_url becomes eap:ca_file by downloading the file
Method triggerNewOCSPStatement
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function triggerNewOCSPStatement($serial): string
{
$cert = new SilverbulletCertificate($serial, \devices\Devices::SUPPORT_EMBEDDED_ECDSA);
$certstatus = "";
// get all relevant info from object properties
Method triggerNewOCSPStatement
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function triggerNewOCSPStatement($serial): string
{
$cert = new SilverbulletCertificate($serial, \devices\Devices::SUPPORT_EMBEDDED_RSA);
$certstatus = "";
// get all relevant info from object properties
Method createCArepository
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
}
if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
Function previewCAinHTML
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function previewCAinHTML($cAReference) {
\core\common\Entity::intoThePotatoes();
$validator = new \web\lib\common\InputValidation();
$ref = $validator->databaseReference($cAReference);
$caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning'];
- 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 checkUploadSanity
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function checkUploadSanity(string $optiontype, string $incomingBinary) {
switch ($optiontype) {
case "general:logo_file":
case "fed:logo_file":
case "internal:logo_from_url":
- 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 furtherStringChecks
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function furtherStringChecks($attribute, $previsionalContent, &$bad) {
$content = FALSE;
switch ($attribute) {
case "media:consortium_OI":
$content = $this->validator->consortiumOI($previsionalContent);
- 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 writeConfigVars
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function writeConfigVars($file) {
$eapMethod = \core\common\EAP::eapDisplayName($this->selectedEap);
$contacts = $this->mkSupportContacts();
$tou = $this->mkUserConsent();
$outerId = $this->determineOuterIdString();
- 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 newIdP
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function newIdP($type, $ownerId, $level, $mail = NULL, $bestnameguess = NULL)
{
$this->databaseHandle->exec("INSERT INTO institution (country, type) VALUES('$this->tld', '$type')");
$identifier = $this->databaseHandle->lastID();
- 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
Function determineOwnCatalogue
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private static function determineOwnCatalogue($showTrace = FALSE)
{
$trace = debug_backtrace();
$caller = [];
// find the first caller in the stack trace which is NOT "Entity" itself
- 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 createIdPFromToken
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function createIdPFromToken(string $token, string $owner)
{
new CAT(); // be sure that Entity's static members are initialised
common\Entity::intoThePotatoes();
// the token either has cat_institution_id set -> new admin for existing inst
- 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 sendRequestToCa
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function sendRequestToCa($csr, $revocationPin, $expiryDays): int
{
// initialise connection to eduPKI CA / eduroam RA and send the request to them
try {
if (in_array("eduroam IdP", $csr["POLICIES"]) && in_array("eduroam SP", $csr["POLICIES"])) {
- 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 thoroughChainChecks
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function thoroughChainChecks(&$testresults, &$intermOdditiesCAT, $tmpDir, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
$crlCheckString = $this->createCArepository($tmpDir, $intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs);
// ... and run the verification test
$verifyResultEaponly = [];
- 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 __validate_user_name
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def __validate_user_name(self) -> bool:
# locate the @ character in username
pos = self.username.find('@')
debug("@ position: " + str(pos))
# trailing @
- 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 relevantNAPTRcompliance
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function relevantNAPTRcompliance()
{
// did we query DNS for the NAPTRs yet? If not, do so now.
if ($this->NAPTR_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
$this->relevantNAPTR();
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($identifier, $certtype = NULL)
{
$this->databaseType = "INST";
parent::__construct();
$this->username = "";
Method sendSMS
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sendSMS($number, $content)
{
$loggerInstance = new \core\common\Logging();
switch (\config\ConfAssistant::SMSSETTINGS['provider']) {
case 'Nexmo':
Function createMsgbox
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createMsgbox(type, onclick) {
var body = document.getElementsByTagName("body")[0];
if (document.getElementById("overlay") === null) {
var overlay = document.createElement("div");
overlay.setAttribute("id", "overlay");