AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Student has 33 functions (exceeds 20 allowed). Consider refactoring.
Open

class Student {
    // Defines for Internship Inventory student Data

    const MAIN_CAMPUS = 'main_campus';
    const DISTANCE_ED = 'distance_ed';
Severity: Minor
Found in class/Student.php - About 4 hrs 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

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

    protected function buildMessage()
    {
        $subjects = Subject::getSubjects();

        $faculty = $this->internship->getFaculty();
Severity: Major
Found in class/Email/ReadyToRegisterEmail.php - About 4 hrs to fix

Function render has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {

      var censusCalendar = null;
      var availableCalendar = null;
      var startCalendar = null;
Severity: Major
Found in javascript/editTerms/EditTerms.jsx - About 4 hrs to fix

Function execute has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        // Get the list of future terms
        $terms = TermFactory::getFutureTermsAssoc();

Severity: Minor
Found in class/Command/SendPendingEnrollmentReminders.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function plugStudentValues has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    protected function plugStudentValues(&$student, \stdClass $data){
        /**********************
        * Basic Demographics *
        **********************/
        $student->setStudentId($data->bannerID);
Severity: Minor
Found in class/DataProvider/Student/WebServiceDataProvider.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getSortButtons has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSortButtons(&$template)
    {
        if (empty($this->table_columns)) {
            return null;
        }
Severity: Minor
Found in class/SubselectPager.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function import has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public static function import($text, $report_errors = true)
    {
        PHPWS_DB::touchDB();

        // first_import makes sure at least one query was completed
Severity: Minor
Found in class/SubselectDatabase.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getJoin has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function getJoin()
    {
        if (empty($this->_join_tables)) {
            return null;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function render has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var AdminsData = null;
        if (this.state.mainData != null) {
            var onAdminDelete = this.onAdminDelete;
            AdminsData = this.state.displayData.map(function (admin) {
Severity: Major
Found in javascript/editAdmin/editAdmin.jsx - About 3 hrs to fix

File otherGoodies.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/***********************
 * Form Save Handler
 * Prevents duplicate form submission.
 */
function setupFormSubmit()
Severity: Minor
Found in javascript/formGoodies/otherGoodies.js - About 3 hrs to fix

Method addWhere has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addWhere($column, $value = null, $operator = null, $conj = null, $group = null, $join = false)
    {
        PHPWS_DB::touchDB();

        $where = new PHPWS_DB_Where;
Severity: Major
Found in class/SubselectDatabase.php - About 3 hrs to fix

Method nickname has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function nickname($first_name)
{
    $shortened = array(
        'Abigail' => 'Abby',
        'Alexander' => 'Alex',
Severity: Major
Found in contrib/createFakeStudents.php - About 3 hrs to fix

Function checkForMissingInput has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkForMissingInput() {
        // Check for missing data
        $missingFieldList = array();

        // Check student ID
Severity: Minor
Found in class/Command/AddInternship.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function buildMessage has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $subjects = Subject::getSubjects();

        $faculty = $this->internship->getFaculty();
Severity: Minor
Found in class/Email/GradSchoolNotificationEmail.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function render has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        if(this.state.data === null){
            return (<div></div>);
        }

Severity: Major
Found in javascript/settings/settings.jsx - About 3 hrs to fix

Method select has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function select($type = null, $sql = null)
    {
        if (empty($sql)) {
            if (!empty($this->sql)) {
                $sql = & $this->sql;
Severity: Major
Found in class/SubselectDatabase.php - About 3 hrs to fix

Method display has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function display()
    {
        javascript('jquery');

        \Layout::addPageTitle('Search Results');
Severity: Major
Found in class/UI/ResultsUI.php - About 3 hrs to fix

Function display has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function display()
    {
        javascript('jquery');

        \Layout::addPageTitle('Search Results');
Severity: Minor
Found in class/UI/ResultsUI.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function _indexBy has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function _indexBy($sql, $indexby, $colMode = false)
    {
        $rows = array();

        if (!is_array($sql) || empty($sql)) {
Severity: Minor
Found in class/SubselectDatabase.php - About 3 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

Severity
Category
Status
Source
Language