AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

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

    public function __construct(Internship $i = null, \PHPWS_User $phpwsUser = null, $timestamp = null, WorkflowState $fromState = null, WorkflowState $toState = null, $note = null)
Severity: Minor
Found in class/ChangeHistory.php - About 45 mins to fix

Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct(Internship $i = null, \PHPWS_User $phpwsUser = null, $timestamp = null, WorkflowState $fromState = null, WorkflowState $toState = null, $note = null)
    {
        if(!is_null($i)){
            $this->id = 0;
            $this->internship_id = $i->getId();
Severity: Minor
Found in class/ChangeHistory.php - About 45 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

Method addJoin has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function addJoin($join_type, $join_from, $join_to, $join_on_1 = null, $join_on_2 = null, $ignore_tables = false)
Severity: Minor
Found in class/SubselectDatabase.php - About 45 mins to fix

Method addWhere has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function addWhere($column, $value = null, $operator = null, $conj = null, $group = null, $join = false)
Severity: Minor
Found in class/SubselectDatabase.php - About 45 mins to fix

Function addColumn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function addColumn($column, $max_min = null, $as = null, $count = false, $distinct = false, $coalesce = null)
    {

        /****
         * What is this for?
Severity: Minor
Found in class/SubselectDatabase.php - About 45 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 getStudent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStudent($studentId){
        if($studentId === null || $studentId == ''){
            throw new \InvalidArgumentException('Missing student ID.');
        }

Severity: Minor
Found in class/DataProvider/Student/WebServiceDataProvider.php - About 45 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 encodeStudents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function encodeStudents(Array $students) {
        $studentArray = array();

        // If an empty array was given, just return an empty JSON array
        if(sizeof($students) === 0){
Severity: Minor
Found in class/Command/GetSearchSuggestions.php - About 45 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

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

    public function __construct(InternSettings $emailSettings, Internship $internship, Term $term, $censusTimestamp, $toUsername, $templateFile)
Severity: Minor
Found in class/Email/EnrollmentReminderEmail.php - About 45 mins to fix

Function checkRequiredFields has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkRequiredFields(Internship $i){
        // Course number and subject are required so we can check against the expected insurance list in doNotification()
        // NB: Course subject and number are not required for secondary parts of multi-part internships
        if(!$i->isSecondaryPart() && $i->getCourseNumber() === null || $i->getCourseNumber() === ''){
            throw new MissingDataException("Please enter a course number.");
Severity: Minor
Found in class/WorkflowTransition/DeanApprove.php - About 45 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

Method addColumn has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function addColumn($column, $max_min = null, $as = null, $count = false, $distinct = false, $coalesce = null)
Severity: Minor
Found in class/SubselectDatabase.php - About 45 mins to fix

Function requireClasses has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function requireClasses()
    {
        if ($this->load_class && is_array($this->load_class)) {
            foreach ($this->load_class as $files) {
                if (!is_array($files)) {
Severity: Minor
Found in class/SubselectDatabase.php - About 45 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 prefixVary has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function prefixVary($sql, $tbl)
    {
        $repl = true;
        $ar = explode("'", $sql);

Severity: Minor
Found in class/SubselectDatabase.php - About 45 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

Consider simplifying this complex logical expression.
Open

        if(($this->wfState instanceof WorkflowState\SigAuthReadyState || $this->wfState instanceof WorkflowState\SigAuthApprovedState || $this->wfState instanceof WorkflowState\DeanApprovedState || $this->wfState instanceof WorkflowState\RegisteredState) && ($conAffil['value'] == 'No') && (!$this->intern->isSecondaryPart())) {
            \NQ::simple('intern', UI\NotifyUI::WARNING, "No contract has been uploaded or affiliation agreement selected. Usually a copy of the signed contract should be uploaded or an affiliation agreement selected.");
        }
Severity: Major
Found in class/InternshipView.php - About 40 mins to fix

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

    public function __construct(Internship $i, $name, $relation, $phone, $email)
Severity: Minor
Found in class/EmergencyContact.php - About 35 mins to fix

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

    public function __construct(InternSettings $emailSettings, Internship $internship, Term $term, $backgroundCheck, $drugCheck) {
Severity: Minor
Found in class/Email/BackgroundCheckEmail.php - About 35 mins to fix

Method addWhere has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function addWhere($column, $value, $operator=null, $conj=null, $group=null)
Severity: Minor
Found in class/SubselectPager.php - About 35 mins to fix

Method _getJoinOn has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function _getJoinOn($join_on_1, $join_on_2, $table1, $table2, $ignore_tables = false)
Severity: Minor
Found in class/SubselectDatabase.php - About 35 mins to fix

Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        // Warning notification for invalid Banner size or Banner ID
        var notification = <div className="alert alert-warning" role="alert">{this.state.errorWarning !== '' ? this.state.errorWarning: this.props.errorWarning}</div>

        // Search bar for inputting the Banner ID
Severity: Minor
Found in javascript/facultyEdit/FacultyEdit.jsx - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    render() {

        // If we have no data, and it's still loading, then return an empty div
        if(this.state.terms === null && this.state.dataLoading === true){
            return (<div></div>);
Severity: Minor
Found in javascript/createInterface/TermBlock.jsx - About 35 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 updateDisplayData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    updateDisplayData(typedName, sort, showFilter, data, display) {
        var filtered = [];

        // First filters data.
        if (showFilter !== null) {
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 35 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