AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

    constructor(props){
        super(props);

        this.handleSearch = this.handleSearch.bind(this);
        this.onKeyPress = this.onKeyPress.bind(this);
Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx and 1 other location - About 1 hr to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 37..42

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

<?php
/**
 * This file is part of Internship Inventory.
 *
 * Internship Inventory is free software: you can redistribute it and/or modify
Severity: Major
Found in class/Command/GetUndergradMajors.php and 1 other location - About 1 hr to fix
class/Command/GetGraduateMajors.php on lines 1..43

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

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

<?php
/**
 * This file is part of Internship Inventory.
 *
 * Internship Inventory is free software: you can redistribute it and/or modify
Severity: Major
Found in class/Command/GetGraduateMajors.php and 1 other location - About 1 hr to fix
class/Command/GetUndergradMajors.php on lines 1..43

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

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

Function handleSubmit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    handleSubmit(e) {
        e.preventDefault();

        var data = {systemName: this.systemNameInput.value,
                    registrarEmail: this.registrarEmailInput.value,
Severity: Minor
Found in javascript/settings/settings.jsx - About 1 hr to fix

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

    render() {
        var eData = null;
        if(this.state.emgConData != null){
            eData = this.state.emgConData.map(function (conData) {
                return (
Severity: Minor
Found in javascript/emergencyContact/EmgContactList.jsx - About 1 hr to fix

Function updateFaculty has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function updateFaculty(faculty)
    {
      // Update the faculty details panel
      var departmentName = $("#internship_department :selected").text();

Severity: Minor
Found in javascript/formGoodies/otherGoodies.js - About 1 hr to fix

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

  render() {
    let icon = ''
    switch (this.props.type) {
      case 'danger':
        icon = 'fa fa-exclamation-triangle'
Severity: Minor
Found in javascript/emergencyContact/Message.jsx - About 1 hr to fix

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

    public function execute()
    {
        // Check permissions
        if(!\Current_User::isDeity()){
            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'You do not have permission to delete internships.');
Severity: Minor
Found in class/Command/DeleteInternship.php - About 1 hr to fix

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

    public function post()
    {
        $subjectId = $_REQUEST['subjectId'];
        $cnum = $_REQUEST['cnum'];

Severity: Minor
Found in class/Command/NormalCoursesRest.php - About 1 hr to fix

Method getObjects has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getObjects($class_name)
    {
        $items = null;
        $result = $this->select();

Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

Method _indexBy has 33 lines of code (exceeds 25 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 1 hr to fix

Method getTableColumns has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTableColumns($fullInfo = false)
    {
        static $table_check = null;

        $table_compare = implode(':', $this->tables);
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

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

            if (this.props.msgType === 'success') {
                notification = <div className="alert alert-success" role="alert">
                                <i className="fa fa-check fa-2x pull-left"></i> {this.props.msg}
                            </div>
            } else if (this.props.msgType === 'error') {
Severity: Major
Found in javascript/editCourses/courseEditor.jsx and 1 other location - About 1 hr to fix
javascript/editCourses/courseEditor.jsx on lines 19..23

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

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

            } else if (this.props.msgType === 'error') {
                notification = <div className="alert alert-danger" role="alert">
                                    <i className="fa fa-times fa-2x pull-left"></i> {this.props.msg}
                               </div>
            }
Severity: Major
Found in javascript/editCourses/courseEditor.jsx and 1 other location - About 1 hr to fix
javascript/editCourses/courseEditor.jsx on lines 15..23

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

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

Method get has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get() {
        $db = \phpws2\Database::newDB();
        $pdo = $db->getPDO();
        $arr = array();

Severity: Minor
Found in class/Command/SubRest.php - About 1 hr to fix

Function constructor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    constructor(props) {
        super(props);

        this.state = {
            mainData: null,
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 1 hr to fix

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

    render(){
        var b = new Date().getTime();
        var a = new Date(this.props.end_date * 1000);
        var year = a.getFullYear();
        var month = a.getMonth() + 1;
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 1 hr to fix

Method exec has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function exec($ch = null)
    {

        if ($ch === null) {
            $this->rawResponse = curl_exec($this->curl);
Severity: Minor
Found in class/DataProvider/Curl.php - About 1 hr to fix

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

    public static function allowed($value)
    {
        if (!is_string($value)) {
            return false;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

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

function createInternship($db, $values) {
  $query = "SELECT NEXTVAL('intern_internship_seq')";
  $id_result = pg_query($query);

  // create new organization
Severity: Major
Found in contrib/importInternships.php and 1 other location - About 1 hr to fix
contrib/importSubHost.php on lines 63..77

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

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