AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Method create_autocomplete_query has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function create_autocomplete_query($row)
{
    extract($row);

    $lfirst = strtolower($first_name);
Severity: Minor
Found in contrib/createFakeStudents.php - About 1 hr to fix

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

    render() {
        var fgClasses = classNames({
                        'form-group': true,
                        'has-error': this.state.hasError
                    });
Severity: Minor
Found in javascript/createInterface/InternationalDropDown.jsx - About 1 hr to fix

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

    render() {
        var fgClasses = classNames({
                        'form-group': true,
                        'has-error': this.state.hasError
                    });
Severity: Minor
Found in javascript/createInterface/LocationBlock.jsx - About 1 hr to fix

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

    render() {
        // Create red asterisk for a required field
        var require = <span style={{color: '#FB0000'}}> *</span>;
        var HostData = null;
        if (this.state.hostDisplayData != null) {
Severity: Minor
Found in javascript/createInterface/HostBlock.jsx - About 1 hr to fix

Function getData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getData() {
        $.ajax({
            url: 'index.php?module=intern&action=HostRest',
            type: 'GET',
            dataType: 'json',
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 1 hr to fix

Method post has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function post() {
        $Main = $_REQUEST['main'];
        $Name = $_REQUEST['name'];
        $Address = $_REQUEST['address'];
        $City = $_REQUEST['city'];
Severity: Minor
Found in class/Command/SubRest.php - About 1 hr to fix

Method showWarnings has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function showWarnings() {

        // Get state of documents or affiliation
        $conAffil = DocumentRest::contractAffilationSelected($this->intern->getId());
        // Show warning if no documents uploaded or affiliation agreement selected but workflow state suggests there should be
Severity: Minor
Found in class/InternshipView.php - About 1 hr to fix

Function onAdminCreate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    onAdminCreate(username, department)
    {
        //var displayName = '';
        var displayData = this.state.displayData;
        var dept = this.state.deptData;
Severity: Minor
Found in javascript/editAdmin/editAdmin.jsx - About 1 hr 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 getTotalRows has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTotalRows()
    {
        /**
         * if total_column is set, use it to get total rows
         */
Severity: Minor
Found in class/SubselectPager.php - About 1 hr 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 addToggleFunction has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function addToggleFunction($function, $toggle=2)
    {
        if (empty($function) || $toggle < 2) {
            return false;
        }
Severity: Minor
Found in class/SubselectPager.php - About 1 hr 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 getMajors has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMajors($term): AcademicMajorList
    {
        if($term === null || $term == '') {
            throw new \InvalidArgumentException('Missing term.');
        }
Severity: Minor
Found in class/DataProvider/Major/BannerMajorsProvider.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $this->to = explode(',', $this->emailSettings->getBackgroundCheckEmail());
        $host = $this->internship->getHost();

Severity: Minor
Found in class/Email/BackgroundCheckEmail.php - About 1 hr 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 copyAddress has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function copyAddress(){

    //copy from Host Details to Supervisor Info
    function doCopySupervisor(){
        $("#internship_supervisor_address").val($("#internship_host_address").text());
Severity: Minor
Found in javascript/formGoodies/copyAddress.js - About 1 hr to fix

Method joinResult has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function joinResult($source_column, $join_table, $join_column, $content_column, $new_name=null, $searchable=false)
    {
        // TODO: this will break if you have more than one db pager at a time
        // TODO: make this a private member variable
        static $join_match = null;
Severity: Minor
Found in class/SubselectPager.php - About 1 hr to fix

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

    public function __construct($id, $username, $firstName, $lastName, $phone, $fax, $streetAddress1, $streetAddress2, $city, $state, $zip)
Severity: Major
Found in class/Faculty.php - About 1 hr to fix

Function handleSave has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    handleSave() {
        this.setState({editMode: false});

        var newStype = ReactDOM.findDOMNode(this.refs.savedStype).value.trim();
        var newDescr = ReactDOM.findDOMNode(this.refs.savedDescr).value.trim();
Severity: Minor
Found in javascript/editTerms/EditTerms.jsx - About 1 hr to fix

Function sortBy has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    sortBy(unsorted, typeOfSort) {
      var sorted = [];
      switch(typeOfSort) {
          case 'subA':
              sorted = unsorted.sort(function (a, b) {
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 1 hr to fix

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

    render(){
        let list
        let DropZone = <div></div>
        // If there is a file uploaded it shows the file, else it shows dropzone so you can upload one
        if (this.state.currentFiles.length > 0) {
Severity: Minor
Found in javascript/contractAffiliation/ContractAffiliation.jsx - About 1 hr to fix

Method execute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute() {
        // Load the existing internship using its ID
        $internship = InternshipFactory::getInternshipById($_REQUEST['internshipId']);

        // Load the emergency contacts from the old internship
Severity: Minor
Found in class/Command/CopyInternshipToNextTerm.php - About 1 hr to fix

Method execute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute()
    {
        /* Check if user should have access to folders */
        if (!\Current_User::isLogged()) {
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING,
Severity: Minor
Found in class/Command/DocumentRest.php - About 1 hr to fix
Severity
Category
Status
Source
Language