Showing 599 of 599 total issues
Function setRADIUSconfig
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function setRADIUSconfig($onlyone = 0, $notify = 0)
{
$remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1;
$toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => ''));
$toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . '&secret=' . $this->secret . '&country=' . $this->getAttributes("internal:country")[0]['value'] . '&';
- 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 opensslCAResult
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function opensslCAResult($host, $opensslbabble)
{
if (preg_match('/connect: Connection refused/', implode($opensslbabble))) {
$this->TLS_CA_checks_result[$host]['status'] = RADIUSTests::RETVAL_CONNECTION_REFUSED;
return RADIUSTests::RETVAL_INVALID;
- 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 run_installer
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def run_installer() -> None:
"""
This is the main installer part. It tests for NM availability
gets user credentials and starts a proper installer.
"""
- 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 newIdP
has 52 lines of code (exceeds 25 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();
Method consolidateUdpResult
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function consolidateUdpResult($host) {
\core\common\Entity::intoThePotatoes();
$ret = [];
$serverCert = [];
$udpResult = $this->UDP_reachability_result[$host];
Method downloadStatsCore
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function downloadStatsCore($detail = '')
{
if ($detail !== 'ORGANISATIONS' && $detail !== 'PROFILES' && $detail !== 'FEDERATION') {
$detail = 'NONE';
}
Method writeInstaller
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeInstaller()
{
$dom = textdomain(NULL);
textdomain("devices");
// create certificate files and save their names in $caFiles array
Method initEduPKISoapSession
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function initEduPKISoapSession($type)
{
// set context parameters common to both endpoints
$context_params = [
'http' => [
Method determineMailsToSend
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function determineMailsToSend() {
$this->mailQueue = [];
// check for IDP_EXISTS_BUT_NO_DATABASE
if (!in_array(AbstractTest::INFRA_NONEXISTENTREALM, $this->possibleFailureReasons) && $this->additionalFindings[AbstractTest::INFRA_NONEXISTENTREALM]['DATABASE_STATUS']['ID2'] < 0) {
$this->mailQueue[] = Logopath::IDP_EXISTS_BUT_NO_DATABASE;
Method magic
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function magic()
{
$this->testId = \core\CAT::uuid();
$this->databaseHandle->exec("INSERT INTO diagnosticrun (test_id, realm, suspects, evidence) VALUES ('$this->testId', '$this->realm', NULL, NULL)");
// simple things first: do we know anything about the realm, either
Method checkLineparse
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkLineparse($inputarray, $desiredCheck) {
foreach ($inputarray as $lineid => $line) {
switch ($desiredCheck) {
case self::LINEPARSE_CHECK_REJECTIGNORE:
if (preg_match("/Attribute 18 (Reply-Message)/", $line) && preg_match("/Reject instead of Ignore at eduroam.org/", $inputarray[$lineid + 1])) {
Method printStatic
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function printStatic()
{
$out = [];
$out[] = '<fieldset class="option_container" id="static_tests">
<legend><strong>';
Method initEduPKISoapSession
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function initEduPKISoapSession($type)
{
// set context parameters common to both endpoints
$context_params = [
'http' => [
Method checkUploadSanity
has 50 lines of code (exceeds 25 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":
Method writeWLANprofile
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber) {
$profileFileCont = '<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>' . $wlanProfileName . '</name>
<SSIDConfig>
Method __construct
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
\core\common\Entity::intoThePotatoes();
$this->templates[WELCOME_ABOARD_PAGEHEADING] = sprintf(_("Welcome aboard the %s user community!"), \config\ConfAssistant::CONSORTIUM['display_name']);
$this->templates[WELCOME_ABOARD_DOWNLOAD] = _("Your download will start shortly. In case of problems with the automatic download please use this direct <a href=''>link</a>.");
$this->templates[WELCOME_ABOARD_HEADING] = sprintf(_("Dear user from %s,"), "<span class='inst_name'></span>");
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