AppStateESS/InternshipInventory

View on GitHub
class/Internship.php

Summary

Maintainability
F
3 days
Test Coverage

Internship has 87 functions (exceeds 20 allowed). Consider refactoring.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Major
Found in class/Internship.php - About 1 day to fix

File Internship.php has 624 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * This file is part of Internship Inventory.
 *
 * Internship Inventory is free software: you can redistribute it and/or modify
Severity: Major
Found in class/Internship.php - About 1 day to fix

Method getCSV has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCSV()
    {
        // Initalize term description list, if needed
        // Store term list in a static var, so hopefully we only do this once per export
        if(!isset(self::$termDescriptionList)){
Severity: Major
Found in class/Internship.php - About 4 hrs to fix

The class Internship has an overall complexity of 144 which is very high. The configured complexity threshold is 50.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

Function getCSV has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCSV()
    {
        // Initalize term description list, if needed
        // Store term list in a static var, so hopefully we only do this once per export
        if(!isset(self::$termDescriptionList)){
Severity: Minor
Found in class/Internship.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

The class Internship has 55 fields. Consider redesigning Internship to keep the number of fields under 15.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

TooManyFields

Since: 0.1

Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

Example

class Person {
   protected $one;
   private $two;
   private $three;
   [... many more fields ...]
}

Source https://phpmd.org/rules/codesize.html#toomanyfields

The class Internship has 140 public methods and attributes. Consider reducing the number of public items to less than 45.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

ExcessivePublicCount

Since: 0.1

A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

Example

public class Foo {
    public $value;
    public $something;
    public $var;
    // [... more more public attributes ...]

    public function doWork() {}
    public function doMoreWork() {}
    public function doWorkAgain() {}
    // [... more more public methods ...]
}

Source https://phpmd.org/rules/codesize.html#excessivepubliccount

Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(Student $student, $term, $location, $state, $country, Department $department, SubHost $sub_host, Supervisor $supervisor){
Severity: Major
Found in class/Internship.php - About 1 hr to fix

The method getCSV() has an NPath complexity of 49152. The configured NPath complexity threshold is 200.
Open

    public function getCSV()
    {
        // Initalize term description list, if needed
        // Store term list in a static var, so hopefully we only do this once per export
        if(!isset(self::$termDescriptionList)){
Severity: Minor
Found in class/Internship.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The class Internship has 1018 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

The method getCSV() has 140 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function getCSV()
    {
        // Initalize term description list, if needed
        // Store term list in a static var, so hopefully we only do this once per export
        if(!isset(self::$termDescriptionList)){
Severity: Minor
Found in class/Internship.php by phpmd

The method getCSV() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
Open

    public function getCSV()
    {
        // Initalize term description list, if needed
        // Store term list in a static var, so hopefully we only do this once per export
        if(!isset(self::$termDescriptionList)){
Severity: Minor
Found in class/Internship.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

The class Internship has a coupling between objects value of 22. Consider to reduce the number of dependencies under 13.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

The method getStartDate has a boolean flag argument $formatted, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getStartDate($formatted=false)
Severity: Minor
Found in class/Internship.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method getEndDate has a boolean flag argument $formatted, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getEndDate($formatted=false)
Severity: Minor
Found in class/Internship.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '649', column '23').
Open

            throw new \InvalidArgumentException('Country code is too long');
Severity: Minor
Found in class/Internship.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '154', column '23').
Open

            throw new \InvalidArgumentException('Invalid location.');
Severity: Minor
Found in class/Internship.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '218', column '20').
Open

        return new \PHPWS_DB('intern_internship');
Severity: Minor
Found in class/Internship.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '235', column '23').
Open

            throw new \Exception($result->toString());
Severity: Minor
Found in class/Internship.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '254', column '23').
Open

            throw new \Exception($result->getMessage(), $result->getCode());
Severity: Minor
Found in class/Internship.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '645', column '23').
Open

            throw new \InvalidArgumentException('Empty country code');
Severity: Minor
Found in class/Internship.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method getCSV uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else{
            $csv['Host Name'] = '';
            $csv['Host Sub Name'] = '';
            $csv['Host Address'] = '';
            $csv['Host City'] = '';
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method isOiedCertified uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else{
            return false;
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method isSecondaryPart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else{
            return false;
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'Intern\LevelFactory' in method 'getLevelFormatted'.
Open

        $levelE = LevelFactory::checkLevelExist($this->level);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            throw new \InvalidArgumentException('Invalid location.');
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getEndDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return $this->end_date;
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\PHPWS_Text' in method 'getRowTags'.
Open

        $tags['WORKFLOW_STATE'] = PHPWS_Text::moduleLink($this->getWorkflowState()->getFriendlyName(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\LevelFactory' in method 'getCSV'.
Open

        $level = LevelFactory::getLevelObjectById($this->getLevel());
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method setOiedCertified uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else{
            $this->oied_certified = 0;
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\PHPWS_Text' in method 'getRowTags'.
Open

        $tags['STUDENT_NAME'] = PHPWS_Text::moduleLink($this->getFullName(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getCSV uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else{
            $csv['Undergrad Major'] = '';
            $csv['Graduate Program'] = '';
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'Intern\LevelFactory' in method 'isGraduate'.
Open

        $level = LevelFactory::getLevelObjectById($this->getLevel());
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPWS_Text' in method 'getRowTags'.
Open

        $tags['TERM'] = PHPWS_Text::moduleLink($term->getDescription(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getLevelFormatted uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else{
            return 'Unknown level';
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getCSV uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else {
            $csv['Course Subject']     = '';
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'Intern\FacultyFactory' in method 'getFaculty'.
Open

        return FacultyFactory::getFacultyObjectById($this->faculty_id);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method isRemote uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else{
            return false;
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\Intern\SupervisorFactory' in method 'getSupervisor'.
Open

        return SupervisorFactory::getSupervisorById($this->getSupervisorId());
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\EmergencyContactFactory' in method 'getEmergencyContactName'.
Open

        $name = EmergencyContactFactory::getContactsForInternship($this);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\EmergencyContactFactory' in method 'getEmergencyContactPhoneNumber'.
Open

        $phone = EmergencyContactFactory::getContactsForInternship($this);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPWS_Text' in method 'getRowTags'.
Open

        $tags['DEPT_NAME'] = PHPWS_Text::moduleLink($d->name, 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPWS_Text' in method 'getRowTags'.
Open

            $tags['FACULTY_NAME'] = PHPWS_Text::moduleLink('&nbsp;', 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Intern\SubHostFactory' in method 'getHost'.
Open

        return SubHostFactory::getSubById($this->getSubId());
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getRowTags uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else{
            // Makes this cell in the table a clickable link, even if there's no faculty name
            $tags['FACULTY_NAME'] = PHPWS_Text::moduleLink('&nbsp;', 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\PHPWS_Error' in method 'delete'.
Open

        if (\PHPWS_Error::logIfError($result)) {
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\LevelFactory' in method 'getLevelFormatted'.
Open

            $levelD = LevelFactory::getLevelObjectById($this->level);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getCSV uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else{
            $csv['Host Super. First Name'] = '';
            $csv['Host Super. Last Name'] = '';
            $csv['Host Super. Title'] = '';
            $csv['Host Super. Phone'] = '';
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'Intern\TermFactory' in method 'getRowTags'.
Open

        $term = TermFactory::getTermByTermCode($this->term);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getCampusFormatted uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return 'Unknown campus';
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class 'Intern\WorkflowStateFactory' in method '__construct'.
Open

        $this->setState(WorkflowStateFactory::getState('CreationState'));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\TermFactory' in method 'getCSV'.
Open

            self::$termDescriptionList = TermFactory::getTermsAssoc();
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method getCSV uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $csv['Contract Uploaded'] = null;
            $csv['Affiliation Uploaded']  = $c['value'];
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getCSV uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $csv['Faculty Super. First Name'] = '';
            $csv['Faculty Super. Last Name']  = '';
            $csv['Faculty Super. Phone']      = '';
            $csv['Faculty Super. Email']      = '';
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getStartDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return $this->start_date;
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\PHPWS_Text' in method 'getRowTags'.
Open

        $tags['STUDENT_BANNER'] = PHPWS_Text::moduleLink($this->getBannerId(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\LevelFactory' in method 'isUndergraduate'.
Open

        $level = LevelFactory::getLevelObjectById($this->getLevel());
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPWS_Text' in method 'getRowTags'.
Open

            $tags['FACULTY_NAME'] = PHPWS_Text::moduleLink($f->getFullName(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\EmergencyContactFactory' in method 'getEmergencyContactRelation'.
Open

        $relationship = EmergencyContactFactory::getContactsForInternship($this);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method isMultipart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else{
            return false;
        }
Severity: Minor
Found in class/Internship.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\PHPWS_Error' in method 'save'.
Open

        if (\PHPWS_Error::logIfError($result)) {
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Intern\Command\DocumentRest' in method 'getCSV'.
Open

        $c = DocumentRest::contractAffilationSelected($this->id);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\WorkflowStateFactory' in method 'getWorkflowState'.
Open

        return WorkflowStateFactory::getState($stateName);
Severity: Minor
Found in class/Internship.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method save() contains an exit expression.
Open

            exit($e->getMessage());
Severity: Minor
Found in class/Internship.php by phpmd

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

TODO found
Open

    // TODO - Get rid of the magic values, use constants
Severity: Minor
Found in class/Internship.php by fixme

TODO found
Open

        //TODO: Use a single $params array instead of making a new array for every call to PHPWS_Test::moduleLink
Severity: Minor
Found in class/Internship.php by fixme

Call to method logIfError from undeclared class \PHPWS_Error
Open

        if (\PHPWS_Error::logIfError($result)) {
Severity: Critical
Found in class/Internship.php by phan

Saw an @override annotation for method \Intern\Internship::getCSV, but could not find an overridden method and it is not a magic method
Open

    public function getCSV()
Severity: Info
Found in class/Internship.php by phan

Call to method moduleLink from undeclared class \PHPWS_Text
Open

        $tags['DEPT_NAME'] = PHPWS_Text::moduleLink($d->name, 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Critical
Found in class/Internship.php by phan

Call to method saveObject from undeclared class \PHPWS_DB
Open

            $result = $db->saveObject($this);
Severity: Critical
Found in class/Internship.php by phan

Call to method moduleLink from undeclared class \PHPWS_Text
Open

        $tags['STUDENT_NAME'] = PHPWS_Text::moduleLink($this->getFullName(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Critical
Found in class/Internship.php by phan

Returning type string|string[] but getTerm() is declared to return int
Open

        return $this->term;
Severity: Minor
Found in class/Internship.php by phan

Returning type null but save() is declared to return \Intern\new
Open

        return $this->id;
Severity: Minor
Found in class/Internship.php by phan

Argument 2 (timestamp) is null but \date() takes int
Open

            return date('F j, Y', $this->end_date);
Severity: Minor
Found in class/Internship.php by phan

Call to method moduleLink from undeclared class \PHPWS_Text
Open

            $tags['FACULTY_NAME'] = PHPWS_Text::moduleLink('&nbsp;', 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Critical
Found in class/Internship.php by phan

Returning type null but getId() is declared to return int
Open

        return $this->id;
Severity: Minor
Found in class/Internship.php by phan

Call to method delete from undeclared class \PHPWS_DB
Open

        $result = $db->delete();
Severity: Critical
Found in class/Internship.php by phan

Call to method __construct from undeclared class \PHPWS_DB
Open

        return new \PHPWS_DB('intern_internship');
Severity: Critical
Found in class/Internship.php by phan

Call to method moduleLink from undeclared class \PHPWS_Text
Open

        $tags['WORKFLOW_STATE'] = PHPWS_Text::moduleLink($this->getWorkflowState()->getFriendlyName(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Critical
Found in class/Internship.php by phan

Call to method addWhere from undeclared class \PHPWS_DB
Open

        $db->addWhere('id', $this->id);
Severity: Critical
Found in class/Internship.php by phan

Call to method moduleLink from undeclared class \PHPWS_Text
Open

            $tags['FACULTY_NAME'] = PHPWS_Text::moduleLink($f->getFullName(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Critical
Found in class/Internship.php by phan

Return type of save() is undeclared type \Intern\new
Open

    public function save()
Severity: Minor
Found in class/Internship.php by phan

Call to method moduleLink from undeclared class \PHPWS_Text
Open

        $tags['STUDENT_BANNER'] = PHPWS_Text::moduleLink($this->getBannerId(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Critical
Found in class/Internship.php by phan

Call to method logIfError from undeclared class \PHPWS_Error
Open

        if (\PHPWS_Error::logIfError($result)) {
Severity: Critical
Found in class/Internship.php by phan

Argument 2 (timestamp) is null but \date() takes int
Open

            return date('F j, Y', $this->start_date);
Severity: Minor
Found in class/Internship.php by phan

Call to method moduleLink from undeclared class \PHPWS_Text
Open

        $tags['TERM'] = PHPWS_Text::moduleLink($term->getDescription(), 'intern', array('action' => 'ShowInternship', 'internship_id' => $this->id));
Severity: Critical
Found in class/Internship.php by phan

Returning type null but getWorkflowState() is declared to return \Intern\WorkflowState
Open

            return null;
Severity: Minor
Found in class/Internship.php by phan

Saw an @override annotation for method \Intern\Internship::getDb, but could not find an overridden method and it is not a magic method
Open

    public function getDb()
Severity: Info
Found in class/Internship.php by phan

The property $first_name_meta is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $form_token is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $loc_province is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $secondary_part is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $course_sect is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $experience_type is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $sub_host is not named in camelCase.
Open

    public function __construct(Student $student, $term, $location, $state, $country, Department $department, SubHost $sub_host, Supervisor $supervisor){
        // Initialize student data
        $this->initalizeStudentData($student);

        // Initialize basic data
Severity: Minor
Found in class/Internship.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public function setId($id){
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The property $department_id is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $middle_name is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $preferred_name is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $host_id is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $f. Configured minimum length is 3.
Open

        $f = $this->getFaculty();
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The property $supervisor_id is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $last_name is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $loc_country is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $start_date is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $corequisite_number is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $f. Configured minimum length is 3.
Open

            $f = $this->getFaculty();
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The property $loc_state is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $oied_certified is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $multi_part is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The property $faculty_id is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $host_sub_id is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $first_name is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $drug_check is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $d. Configured minimum length is 3.
Open

        $d = $this->getDepartment();
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The property $background_check is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $c. Configured minimum length is 3.
Open

        $c = DocumentRest::contractAffilationSelected($this->id);
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The property $avg_hours_week is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $last_name_meta is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $pay_rate is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $course_title is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $preferred_name_meta is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $major_code is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $course_subj is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $corequisite_section is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $d. Configured minimum length is 3.
Open

        $d = $this->getDepartment();
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The parameter $sup_id is not named in camelCase.
Open

    public function setSupervisorId($sup_id) {
        $this->supervisor_id = $sup_id;
    }
Severity: Minor
Found in class/Internship.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The property $loc_phone is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $major_description is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $end_date is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = $this->getDb();
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = $this->getDb();
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $s. Configured minimum length is 3.
Open

        $s = $this->getHost();
Severity: Minor
Found in class/Internship.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The property $middle_name_meta is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $remote_state is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $course_no is not named in camelCase.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The variable $sup_id is not named in camelCase.
Open

    public function setSupervisorId($sup_id) {
        $this->supervisor_id = $sup_id;
    }
Severity: Minor
Found in class/Internship.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $sub_host is not named in camelCase.
Open

    public function __construct(Student $student, $term, $location, $state, $country, Department $department, SubHost $sub_host, Supervisor $supervisor){
        // Initialize student data
        $this->initalizeStudentData($student);

        // Initialize basic data
Severity: Minor
Found in class/Internship.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $sub_host is not named in camelCase.
Open

    public function __construct(Student $student, $term, $location, $state, $country, Department $department, SubHost $sub_host, Supervisor $supervisor){
        // Initialize student data
        $this->initalizeStudentData($student);

        // Initialize basic data
Severity: Minor
Found in class/Internship.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status