Showing 529 of 599 total issues

Function testMakensis has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function testMakensis()
    {
        if (!is_numeric(\config\ConfAssistant::NSIS_VERSION)) {
            $this->storeTestResult(\core\common\Entity::L_ERROR, "NSIS_VERSION needs to be numeric!");
            return;
Severity: Minor
Found in core/SanityTests.php - About 1 hr to fix

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 longestNameSuffix has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function longestNameSuffix()
    {
        // for all configured server names, find the string that is the longest
        // suffix to all of them
        $longestSuffix = "";
Severity: Minor
Found in core/DeviceConfig.php - About 1 hr to fix

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 writeInstaller has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function writeInstaller()
    {
        \core\common\Entity::intoThePotatoes();
        $this->prepareInstallerLang();
        $this->setupEapConfig();
Severity: Minor
Found in devices/ms/DeviceW8W10.php - About 1 hr to fix

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 processCertificate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function processCertificate($cadata)
    {
        $pemBegin = strpos($cadata, "-----BEGIN CERTIFICATE-----");
        if ($pemBegin !== FALSE) {
            $pemEnd = strpos($cadata, "-----END CERTIFICATE-----") + 25;
Severity: Minor
Found in core/common/X509.php - About 1 hr to fix

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 __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($idpObject, $deploymentIdRaw, $consortium = 'eduroam')
    {
        parent::__construct($idpObject, $deploymentIdRaw); // we now have access to our INST database handle and logging
        $this->entityOptionTable = "deployment_option";
        $this->entityIdColumn = "deployment_id";
Severity: Minor
Found in core/DeploymentManaged.php - About 1 hr to fix

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 __get_graphics_support has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def __get_graphics_support(self) -> None:
        self.graphics = 'tty'
        if self.gui == 'tty':
            return
        if os.environ.get('DISPLAY') is None:
Severity: Minor
Found in devices/linux/Files/main.py - About 1 hr to fix

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 __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, silent: bool = False, username: str = '',
                 password: str = '', pfx_file: str = '', gui: str = '') -> None:
        self.graphics = ''
        self.username = username
        self.password = password
Severity: Minor
Found in devices/linux/Files/main.py - About 1 hr to fix

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 displaySilverbulletPropertyWidget has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) {
    ?>
    <div style='padding-bottom:20px;'>
        <h2><?php echo $theProfile->name; ?></h2>
        <?php
Severity: Minor
Found in web/admin/overview_org.php - About 1 hr to fix

    Method update_table has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function update_table($table_name) {
            $table = 'view_'.$table_name;
            $tmp_table = 'tmp_'.$table_name;
            if ($this->tablesource[$table_name] == 'eduroam') {
                $this->db_local->select_db('monitor_copy');
    Severity: Minor
    Found in utils/update_monitor_copy.php - About 1 hr to fix

      Method combineLogo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function combineLogo($logos = NULL, $fedLogo = NULL)
          {
              // maximum size to which we want to resize the logos
      
              $maxSize = 120;
      Severity: Minor
      Found in devices/ms/WindowsCommon.php - About 1 hr to fix

        Method writeMessages has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function writeMessages($file) {
                \core\common\Entity::intoThePotatoes();
                $messages = [
                'quit'=> _("Really quit?"),
                'username_prompt'=> _("enter your userid"),
        Severity: Minor
        Found in devices/linux/DeviceLinux.php - About 1 hr to fix

          Method eapBlock has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function eapBlock($caRefs)
              {
                  $selectedEap = $this->selectedEap;
                  $outerId = $this->determineOuterIdString();
                  $eapPrettyprint = \core\common\EAP::eapDisplayName($selectedEap);
          Severity: Minor
          Found in devices/chromebook/DeviceChromebook.php - About 1 hr to fix

            Method saveNetworkProfileSeparateHS has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function saveNetworkProfileSeparateHS($profileName, $network)
                {
                    $out = '';
                    if (!empty($network['ssid'])) {
                        if ($this::separateSSIDprofiles === true && !empty($network['condition']) && $network['condition'] === 'locally_defined') {
            Severity: Minor
            Found in devices/ms/DeviceW8W10.php - About 1 hr to fix

              Method generateNewInstaller has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function generateNewInstaller($device, $profile, $generatedFor, $openRoaming, $token, $password)
                  {
                      $this->loggerInstance->debug(5, "generateNewInstaller() - Enter");
                      $this->loggerInstance->debug(5, "generateNewInstaller:openRoaming:$openRoaming\n");
                      $factory = new DeviceFactory($device);
              Severity: Minor
              Found in core/UserAPI.php - About 1 hr to fix

                Method __construct has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function __construct()
                    {
                            
                        if ( \config\ConfAssistant::eduPKI['testing'] === true ) {
                            $this->locationRaCert = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem";
                Severity: Minor
                Found in core/CertificationAuthorityEduPkiServer.php - About 1 hr to fix

                  Method addCrltoCert has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function addCrltoCert(&$cert) {
                          $crlUrl = [];
                          $returnresult = 0;
                          if (!isset($cert['full_details']['extensions']['crlDistributionPoints'])) {
                              return RADIUSTests::CERTPROB_NO_CDP;
                  Severity: Minor
                  Found in core/diag/RADIUSTests.php - About 1 hr to fix

                    Function row_filter has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function row_filter(tbody) {
                        var linked = tbody.find('[id^="unlinked_ck_"]').is(':checked');
                        var broken_cert = tbody.find('[id^="brokencert_ck_"]').is(':checked');
                        var or_warn = tbody.find('[id^="or_ck_"]').is(':checked');
                        var profile_warn = tbody.find('[id^="profile_ck_"]').is(':checked');
                    Severity: Minor
                    Found in web/admin/js/nro.js - About 1 hr to fix

                      Method deleteObsoleteTempDirs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function deleteObsoleteTempDirs() {
                              $downloadsDirs = [
                                  'site_installers' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/installer_cache",
                                  'silverbullet' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/silverbullet"
                              ];
                      Severity: Minor
                      Found in web/lib/admin/Maintenance.php - About 1 hr to fix

                        Method saveCertificateFiles has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            final protected function saveCertificateFiles($format)
                            {
                                switch ($format) {
                                    case "der": // fall-thorugh, same treatment
                                    case "pem":
                        Severity: Minor
                        Found in core/DeviceConfig.php - About 1 hr to fix

                          Method __construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function __construct($realm, $outerUsernameForChecks, $supportedEapTypes = [], $expectedServerNames = [], $expectedCABundle = []) {
                                  parent::__construct();
                          
                                  $this->realm = $realm;
                                  $this->outerUsernameForChecks = $outerUsernameForChecks;
                          Severity: Minor
                          Found in core/diag/RADIUSTests.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language