AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

Function getPrintableGenderAbbreviation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPrintableGenderAbbreviation()
    {
        $gender = $this->getGender();

        if ($gender === '' || is_null($gender)) {
Severity: Minor
Found in class/Student.php - About 25 mins 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 getEnabledFeaturesForStudent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getEnabledFeaturesForStudent(Student $student, $term)
    {
        $db = new PHPWS_DB('hms_application_feature');
        $db->addWhere('enabled', 1);
        $db->addWhere('term', $term);
Severity: Minor
Found in class/ApplicationFeature.php - About 25 mins 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 reportToStudentAccount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function reportToStudentAccount()
    {
        $soap = SOAP::getInstance(UserStatus::getUsername(), SOAP::ADMIN_USER);

        $damage = RoomDamageFactory::getDamageById($this->getDamageId());
Severity: Minor
Found in class/RoomDamageResponsibility.php - About 25 mins 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 getFullName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFullName()
    {
        if (isset($this->preferred_name) && $this->preferred_name != '') {
            $firstName = $this->getPreferredName();
            if (isset($this->middle_name) && $this->middle_name != $this->preferred_name) {
Severity: Minor
Found in class/Student.php - About 25 mins 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 getMembership has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getMembership($permission=null, $object=null, $username=null, $display_name=false){
        $db = self::getDb();
        $db->addJoin('left outer', 'hms_permission', 'hms_role_perm', 'id', 'permission');
        $db->addJoin('left outer', 'hms_role_perm', 'hms_role', 'role', 'id');
        $db->addJoin('left outer', 'hms_role', 'hms_user_role', 'id', 'role');
Severity: Minor
Found in class/HMS_Permission.php - About 25 mins 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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        $semester = Term::getTermSem(Term::getSelectedTerm());

        if($semester != TERM_FALL && $semester != TERM_SPRING){
Severity: Minor
Found in class/Report/SingleGenderVsCoedPref/SingleGenderVsCoedPref.php - About 25 mins 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 assign has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function assign(AssignmentPairing $pair, Room $room)
    {
        if(!$this->allowed($pair, $room)) {
            throw new AssignmentException('Cannot assign ' . $pair->__tostring() . ' to ' . $room->__tostring());
        }
Severity: Minor
Found in class/AssignmentStrategy.php - About 25 mins 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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function render() {
        $hall = null;
        $tpl = new \PHPWS_Template('hms');
        $tpl->setFile('admin/reports/FloorRoster.tpl');

Severity: Minor
Found in class/Report/FloorRoster/FloorRosterHtmlView.php - About 25 mins 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 getPagerTags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPagerTags()
    {
        $tpl = array();

        try {
Severity: Minor
Found in class/HMS_Activity_Log.php - About 25 mins 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 initializeArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function initializeArray(Array &$arr)
    {
        // Initialize the multi-dimensional array
        foreach($this->studentTypes as $t){
            foreach($this->classes as $c){
Severity: Minor
Found in class/Report/AssignmentDemographics/AssignmentDemographics.php - About 25 mins 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 show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'edit_terms')){
            throw new PermissionException('You do not have permission to edit terms.');
        }
Severity: Minor
Found in class/CreateTermView.php - About 25 mins 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 updateEnvelope has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateEnvelope()
    {
        $docusignUsername = \PHPWS_Settings::get('hms', 'docusign_username');
        if ($docusignUsername === null || $docusignUsername == '') {
            throw new InvalidConfigurationException('Missing docusign username.');
Severity: Minor
Found in class/Contract.php - About 25 mins 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 getStudentProfile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStudentProfile($bannerId, $term)
    {
        // Sanity checking on the username
        if(empty($bannerId) || is_null($bannerId) || !isset($bannerId)){
            throw new \InvalidArgumentException('Bad BannerId.');
Severity: Minor
Found in class/TestSOAP.php - About 25 mins 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 getClient has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getClient()
    {
        $docusignUsername = \PHPWS_Settings::get('hms', 'docusign_username');
        if ($docusignUsername === null || $docusignUsername == '') {
            throw new InvalidConfigurationException('Missing docusign username.');
Severity: Minor
Found in class/DocusignClientFactory.php - About 25 mins 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 show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {

        //Seriously php?  Can't resolve context without this?  Fail.
        $context = $this->context;
Severity: Minor
Found in class/RlcApplicationPage2View.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($id = 0, $user_id = null, $timestamp = null,
    $activity = null, $actor = null, $notes = null)
    {
        $this->activity_text = HMS_Activity_Log::getActivityMapping();

Severity: Minor
Found in class/HMS_Activity_Log.php - About 25 mins 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 sendContractToStudent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function sendContractToStudent($student, $term, $docusignClient, $http, $templateId, $under18TemplateId)
{
    $under18 = $student->isUnder18();

    $templateRoles = array(
Severity: Minor
Found in contrib/sendDocusignContract.php - About 25 mins 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

Severity
Category
Status
Source
Language