Showing 599 of 599 total issues

Function relevantNAPTRsrvResolution has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function relevantNAPTRsrvResolution()
    {
// see if preceding checks have been run, and run them if not
// compliance check will cascade NAPTR check on its own
        if ($this->NAPTR_compliance_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
Severity: Minor
Found in core/diag/RFC7585Tests.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 getCollapsedAttributes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCollapsedAttributes($eap = [])
    {
        $collapsedList = [];
        foreach ($this->getAttributes() as $attribute) {
            // filter out eap-level attributes not pertaining to EAP type $eap
Severity: Minor
Found in core/AbstractProfile.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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if ( \config\ConfAssistant::eduPKI['testing'] === true ) {
            $this->locationRaCert = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem";
            $this->locationRaKey = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey";
            $this->locationWebRoot = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
            $this->eduPkiRaId = 700;
Severity: Major
Found in core/CertificationAuthorityEduPkiServer.php and 1 other location - About 1 hr to fix
core/CertificationAuthorityEduPkiServer.php on lines 49..60

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (!preg_match("/OK$/", $verifyResultAllcerts[0])) { // case 1
            if (preg_match("/certificate revoked$/", $verifyResultAllcerts[1])) {
                $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_SERVER_CERT_REVOKED;
            } elseif (preg_match("/unable to get certificate CRL/", $verifyResultAllcerts[1])) {
                $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_UNABLE_TO_GET_CRL;
Severity: Major
Found in core/diag/RADIUSTests.php and 1 other location - About 1 hr to fix
core/diag/RADIUSTests.php on lines 789..798

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        } else {
            $this->locationRaCert = ROOT . "/config/SilverbulletClientCerts/edupki-prod-ra.pem";
            $this->locationRaKey = ROOT . "/config/SilverbulletClientCerts/edupki-prod-ra.clearkey";
            $this->locationWebRoot = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
            $this->eduPkiRaId = 100;
Severity: Major
Found in core/CertificationAuthorityEduPkiServer.php and 1 other location - About 1 hr to fix
core/CertificationAuthorityEduPkiServer.php on lines 38..60

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (!preg_match("/OK$/", $verifyResultEaponly[0])) { // case 2
            if (preg_match("/certificate revoked$/", $verifyResultEaponly[1])) {
                $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_SERVER_CERT_REVOKED;
            } elseif (preg_match("/unable to get certificate CRL/", $verifyResultEaponly[1])) {
                $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_UNABLE_TO_GET_CRL;
Severity: Major
Found in core/diag/RADIUSTests.php and 1 other location - About 1 hr to fix
core/diag/RADIUSTests.php on lines 779..788

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method uglify has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function uglify($parameters) {
        $coercedInline = [];
        $coercedFile = [];
        $optionObject = \core\Options::instance();
        $dir = \core\common\Entity::createTemporaryDirectory('test');
Severity: Minor
Found in web/lib/admin/API.php - About 1 hr to fix

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

        public function __construct($fedname)
        {
    
            // initialise the superclass variables
    
    
    Severity: Minor
    Found in core/Federation.php - About 1 hr to fix

      Method relevantNAPTRsrvResolution has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function relevantNAPTRsrvResolution()
          {
      // see if preceding checks have been run, and run them if not
      // compliance check will cascade NAPTR check on its own
              if ($this->NAPTR_compliance_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
      Severity: Minor
      Found in core/diag/RFC7585Tests.php - About 1 hr to fix

        Method relevantNAPTR has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function relevantNAPTR()
            {
                if ($this->discoveryTag == "") {
                    $this->NAPTR_executed = RADIUSTests::RETVAL_NOTCONFIGURED;
                    return RADIUSTests::RETVAL_NOTCONFIGURED;
        Severity: Minor
        Found in core/diag/RFC7585Tests.php - About 1 hr to fix

          Method thoroughChainChecks has 38 lines of code (exceeds 25 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 = [];
          Severity: Minor
          Found in core/diag/RADIUSTests.php - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            function removeQRbox() {
                var body = document.getElementsByTagName("body")[0];
                body.removeChild(document.getElementById("overlay"));
                body.removeChild(document.getElementById("qrbox"));
            }
            Severity: Major
            Found in web/admin/js/popup_redirect.js and 1 other location - About 1 hr to fix
            web/admin/js/popup_redirect.js on lines 114..118

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 65.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            function removeMsgbox() {
                var body = document.getElementsByTagName("body")[0];
                body.removeChild(document.getElementById("overlay"));
                body.removeChild(document.getElementById("msgbox"));
            }
            Severity: Major
            Found in web/admin/js/popup_redirect.js and 1 other location - About 1 hr to fix
            web/admin/js/popup_redirect.js on lines 120..124

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 65.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method authenticate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function authenticate() {
                    \core\common\Entity::intoThePotatoes();
                    $loggerInstance = new \core\common\Logging();
                    $authSimple = new \SimpleSAML\Auth\Simple(\config\Master::AUTHENTICATION['ssp-authsource']);
                    $authSimple->requireAuth();
            Severity: Minor
            Found in web/lib/admin/Authentication.php - About 1 hr to fix

              Method getExternalDBEntityDetails has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getExternalDBEntityDetails($externalId, $realm = NULL)
                  {
                      $list = [];
                      if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam" && isset(\config\ConfAssistant::CONSORTIUM['deployment-voodoo']) && \config\ConfAssistant::CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
                          $scanforrealm = "";
              Severity: Minor
              Found in core/CAT.php - About 1 hr to fix

                Method writeNsisDefines has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function writeNsisDefines($attr)
                    {
                        $fcontents = '';
                        if ($attr['internal:profile_count'][0] > 1) {
                            $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0])) . '"
                Severity: Minor
                Found in devices/ms/WindowsCommon.php - About 1 hr to fix

                  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 = [];
                  Severity: Minor
                  Found in core/IdPlist.php - About 1 hr to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            $soap = new \SoapClient($url, [
                                'soap_version' => SOAP_1_1,
                                'trace' => TRUE,
                                'exceptions' => TRUE,
                                'connection_timeout' => 5, // if can't establish the connection within 5 sec, something's wrong
                    Severity: Major
                    Found in core/CertificationAuthorityEduPkiServer.php and 1 other location - About 1 hr to fix
                    core/CertificationAuthorityEduPki.php on lines 322..340

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 110.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            $soap = new \SoapClient($url, [
                                'soap_version' => SOAP_1_1,
                                'trace' => TRUE,
                                'exceptions' => TRUE,
                                'connection_timeout' => 5, // if can't establish the connection within 5 sec, something's wrong
                    Severity: Major
                    Found in core/CertificationAuthorityEduPki.php and 1 other location - About 1 hr to fix
                    core/CertificationAuthorityEduPkiServer.php on lines 408..426

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 110.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Method caBlob has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function caBlob($ca)
                        {
                            \core\common\Entity::intoThePotatoes();
                            $stream = "";
                            if (!in_array($ca['uuid'], $this->CAsAccountedFor)) { // skip if this is a duplicate
                    Severity: Minor
                    Found in devices/apple_mobileconfig/MobileconfigSuperclass.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language