AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Avoid too many return statements within this method.
Open

                return $result;
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return true;
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return PHPWS_DB::_indexBy($result, $indexby, true);
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return $maxID;
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $GLOBALS['PHPWS_DB']['connection']->queryCol($sql);
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return preg_replace('/\(+.*$/', '', str_replace('`', '', $format[3]));
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return $result['count'];
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                        return $result;
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return preg_replace('/;/', '', str_replace('`', '', $format[2]));
Severity: Major
Found in class/SubselectDatabase.php - About 30 mins to fix

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

    render() {
        var dData = null;
        if (this.state.dropData != null) {
            // Maps the dropdown department data and calls the DepartmentList class
            dData = this.state.dropData.map(function (dept) {
Severity: Minor
Found in javascript/facultyEdit/FacultyEdit.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    render() {
        var options = this.props.departments;

        var selectOptions = options.map(function(department){

Severity: Minor
Found in javascript/affiliationAgreement/AffiliationDepartments.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    render() {
        var options = this.props.locations;

        var selectOptions = options.map(function(location){

Severity: Minor
Found in javascript/affiliationAgreement/AffiliationLocation.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    searchListByName(data, nameToSearch, display) {
      var filtered = [];
      // Looks for the name by filtering the mainData
      for (var i = 0; i < data.length; i++) {
          var item = data[i];
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

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

Cognitive Complexity

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

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

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

Further reading

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

    public function put()
    {
        $id = $_REQUEST['internId'];

        $db = Database::newDB();
Severity: Minor
Found in class/Command/AgreementTypeRest.php - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    render() {

        var AffiliateData = null;
        if (this.state.mainData != null) {
            AffiliateData = this.state.displayData.map(function (affil) {
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    formatPhone(event) {
        var input = event.target.value;
        // Strip all characters from the input except digits
        input = input.replace(/\D/g,'');

Severity: Minor
Found in javascript/emergencyContact/EmgContactList.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    render() {
        var fgClasses = classNames({'form-group': true, 'has-error': this.state.hasError});

        var availHostOptions = null;
        if (this.state.availableHost != null) {
Severity: Minor
Found in javascript/location/Location.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    handleDrop(e){
        //Event handler for the dropdown box.
        if (e.target.value !== 'AA')
        {
            // Determines the text value (not abbr) of the selected state.
Severity: Minor
Found in javascript/stateList/StateList.jsx - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

Severity
Category
Status
Source
Language