AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

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 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 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 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 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 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

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

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                        <select id="country" name="country" className="form-control">
                            {Object.keys(countries).map(function(key) {
                                return <option key={key} value={key}>{countries[key]}</option>;
                            })}
                        </select>
Severity: Major
Found in javascript/createInterface/InternationalDropDown.jsx and 2 other locations - About 1 hr to fix
javascript/createInterface/DepartmentBlock.jsx on lines 45..49
javascript/createInterface/InternationalDropDown.jsx on lines 33..37

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                        <select id="department2" name="department" className="form-control" defaultValue="-1">
                            {Object.keys(departments).map(function(key) {
                                return <option key={key} value={key}>{departments[key]}</option>;
                            })}
                        </select>
Severity: Major
Found in javascript/createInterface/DepartmentBlock.jsx and 2 other locations - About 1 hr to fix
javascript/createInterface/InternationalDropDown.jsx on lines 33..37
javascript/createInterface/InternationalDropDown.jsx on lines 47..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                            <select id="country" onChange={this.handleDrop} name="country" className="form-control">
                                {Object.keys(countries).map(function(key) {
                                    return <option key={key} value={key}>{countries[key]}</option>;
                                })}
                            </select>
Severity: Major
Found in javascript/createInterface/InternationalDropDown.jsx and 2 other locations - About 1 hr to fix
javascript/createInterface/DepartmentBlock.jsx on lines 45..49
javascript/createInterface/InternationalDropDown.jsx on lines 47..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    constructor(props){
        super(props);

        this.handleChange = this.handleChange.bind(this);
        this.onShowAffiliate = this.onShowAffiliate.bind(this);
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 1 other location - About 1 hr to fix
javascript/facultyEdit/FacultyEdit.jsx on lines 11..16

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language