core/CAT.php

Summary

Maintainability
F
3 days
Test Coverage

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

    public function __construct()
    {
        parent::__construct();
        common\Entity::intoThePotatoes();

Severity: Major
Found in core/CAT.php - About 1 day to fix

    File CAT.php has 479 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: Minor
    Found in core/CAT.php - About 7 hrs to fix

      Method listAllIdentityProviders has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function listAllIdentityProviders($activeOnly = 0, $country = "")
          {
              common\Entity::intoThePotatoes();
              $handle = DBConnection::handle("INST");
              $handle->exec("SET SESSION group_concat_max_len=10000");
      Severity: Major
      Found in core/CAT.php - About 2 hrs to fix

        Function getExternalDBEntityDetails has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 listAllIdentityProviders has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            public function listAllIdentityProviders($activeOnly = 0, $country = "")
            {
                common\Entity::intoThePotatoes();
                $handle = DBConnection::handle("INST");
                $handle->exec("SET SESSION group_concat_max_len=10000");
        Severity: Minor
        Found in core/CAT.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

        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

          There are no issues that match your filters.

          Category
          Status