Showing 599 of 599 total issues

Similar blocks of code found in 2 locations. 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
Severity: Major
Found in core/CertificationAuthorityEmbeddedRSA.php and 1 other location - About 3 days to fix
core/CertificationAuthorityEmbeddedECDSA.php on lines 104..170

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 695.

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

    public function triggerNewOCSPStatement($serial): string
    {
        $cert = new SilverbulletCertificate($serial, \devices\Devices::SUPPORT_EMBEDDED_ECDSA);
        $certstatus = "";
        // get all relevant info from object properties
Severity: Major
Found in core/CertificationAuthorityEmbeddedECDSA.php and 1 other location - About 3 days to fix
core/CertificationAuthorityEmbeddedRSA.php on lines 104..170

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 695.

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

File cat-user.css.php has 1226 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 * *****************************************************************************
 * Contributions to this work were made on behalf of the GÉANT project, a 
 * project that has received funding from the European Union’s Framework 
Severity: Major
Found in web/skins/modern/resources/css/cat-user.css.php - About 3 days to fix

    File main.py has 1052 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python3
    """
     * **************************************************************************
     * Contributions to this work were made on behalf of the GÉANT project,
     * a project that has received funding from the European Union’s Framework
    Severity: Major
    Found in devices/linux/Files/main.py - About 2 days to fix

      Method listDevices has 514 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function listDevices($profile = 0, $orAlways = 0) {
              \core\common\Entity::intoThePotatoes();
              $lang = new \core\common\Language();
      /*      Uncomment lines below if you have button images and want to use them
       * 
      Severity: Major
      Found in devices/Devices-template.php - About 2 days to fix

        File action_realmcheck.php has 914 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*
         * *****************************************************************************
         * Contributions to this work were made on behalf of the GÉANT project, a 
         * project that has received funding from the European Union’s Framework 
        Severity: Major
        Found in web/diag/action_realmcheck.php - About 2 days to fix

          Function collectClients has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
          Open

              private function collectClients()
              {
                  $clientstest = [];
                  foreach ($this->allReachabilityResults['clients'] as $clients) {
                      if ($clients->result == RADIUSTests::RETVAL_SKIPPED) {
          Severity: Minor
          Found in core/diag/RADIUSTestsUI.php - About 2 days 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

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

          if (isset($_GET['invitation'])) {
              echo "<div class='ca-summary' style='position:relative;'><table>";
              $counter = $validator->integer($_GET['successcount']);
              if ($counter === FALSE) {
                  $counter = 1;
          Severity: Major
          Found in web/admin/inc/manageAdmins.inc.php and 1 other location - About 2 days to fix
          web/admin/overview_federation.php on lines 227..278

          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 437.

          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

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

              if (isset($_GET['invitation'])) {
                  echo "<div class='ca-summary' style='position:relative;'><table>";
                  $counter = $validator->integer($_GET['successcount']);
                  if ($counter === FALSE) {
                      $counter = 1;
          Severity: Major
          Found in web/admin/overview_federation.php and 1 other location - About 2 days to fix
          web/admin/inc/manageAdmins.inc.php on lines 99..150

          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 437.

          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

          File cat.css.php has 864 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*
           * *****************************************************************************
           * Contributions to this work were made on behalf of the GÉANT project, a 
           * project that has received funding from the European Union’s Framework 
          Severity: Major
          Found in web/resources/css/cat.css.php - About 2 days to fix

            File cat_js.php has 852 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /*
             * *****************************************************************************
             * Contributions to this work were made on behalf of the GÉANT project, a 
             * project that has received funding from the European Union’s Framework 
            Severity: Major
            Found in web/skins/modern/user/js/cat_js.php - About 2 days to fix

              File RADIUSTests.php has 813 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /*
               * *****************************************************************************
               * Contributions to this work were made on behalf of the GÉANT project, a 
              Severity: Major
              Found in core/diag/RADIUSTests.php - About 1 day to fix

                File diag.php has 798 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*
                 * *****************************************************************************
                 * Contributions to this work were made on behalf of the GÉANT project, a 
                 * project that has received funding from the European Union’s Framework 
                Severity: Major
                Found in web/skins/modern/diag/diag.php - About 1 day to fix

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

                  <?php
                  /*
                   * *****************************************************************************
                   * Contributions to this work were made on behalf of the GÉANT project, a 
                   * project that has received funding from the European Union’s Framework 
                  Severity: Major
                  Found in web/404.php and 1 other location - About 1 day to fix
                  web/4013.php on lines 1..62

                  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 373.

                  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

                  <?php
                  /*
                   * *****************************************************************************
                   * Contributions to this work were made on behalf of the GÉANT project, a 
                   * project that has received funding from the European Union’s Framework 
                  Severity: Major
                  Found in web/4013.php and 1 other location - About 1 day to fix
                  web/404.php on lines 1..62

                  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 373.

                  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

                      public function __construct()
                      {
                          $this->databaseType = "INST";
                          parent::__construct();
                          $this->rootPem = file_get_contents(CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
                  Severity: Major
                  Found in core/CertificationAuthorityEmbeddedECDSA.php and 1 other location - About 1 day to fix
                  core/CertificationAuthorityEmbeddedRSA.php on lines 63..94

                  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 358.

                  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

                      public function __construct()
                      {
                          $this->databaseType = "INST";
                          parent::__construct();
                          $this->rootPem = file_get_contents(CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA);
                  Severity: Major
                  Found in core/CertificationAuthorityEmbeddedRSA.php and 1 other location - About 1 day to fix
                  core/CertificationAuthorityEmbeddedECDSA.php on lines 63..94

                  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 358.

                  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

                  File SanityTests.php has 687 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /*
                   * *****************************************************************************
                   * Contributions to this work were made on behalf of the GÉANT project, a 
                  Severity: Major
                  Found in core/SanityTests.php - About 1 day to fix

                    Function listDevices has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function listDevices()
                        {
                            $returnarray = [];
                            $redirect = $this->getAttributes("device-specific:redirect"); // this might return per-device ones or the general one
                            // if it was a general one, we are done. Find out if there is one such
                    Severity: Minor
                    Found in core/AbstractProfile.php - About 1 day 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

                    File overview_org.php has 662 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /*
                     * *****************************************************************************
                     * Contributions to this work were made on behalf of the GÉANT project, a 
                     * project that has received funding from the European Union’s Framework 
                    Severity: Major
                    Found in web/admin/overview_org.php - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language