AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

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

    render() {
        var textDes = null;
        var textLev = null;
        var eButton = null;
        var textName = <span className="text-muted"> {this.props.code} </span>;
Severity: Minor
Found in javascript/editLevel/editLevel.jsx - About 1 hr to fix

Function render has 27 lines of code (exceeds 25 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 1 hr to fix

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

    render() {
        // Warning notification for invalid Banner size or Banner ID
        var notification = <div className="alert alert-warning" role="alert">{this.state.errorWarning !== '' ? this.state.errorWarning: this.props.errorWarning}</div>

        // Search bar for inputting the Banner ID
Severity: Minor
Found in javascript/facultyEdit/FacultyEdit.jsx - About 1 hr to fix

Function render has 27 lines of code (exceeds 25 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 1 hr to fix

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

    render() {
        var name = null;
        var hButton = null;
        // Determines which element to show on the page (hide/show and Save/Edit)
        if (this.props.hidden === 0) {
Severity: Minor
Found in javascript/manager/Manager.jsx - About 1 hr to fix

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

    public function getStudent($studentId){
        if($studentId === null || $studentId == ''){
            throw new \InvalidArgumentException('Missing student ID.');
        }

Severity: Minor
Found in class/DataProvider/Student/WebServiceDataProvider.php - About 1 hr to fix

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

    protected static function buildSwiftMessage($to, $fromAddress, $fromName, $subject, $content, $cc = NULL, $bcc = NULL){

        // Sanity checking
        if(!isset($to) || $to === null){
            throw new \InvalidArgumentException('\"To\" not set.');
Severity: Minor
Found in class/Email/Email.php - About 1 hr to fix

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

    public static function homogenize(&$query)
    {
        $query_list = explode(',', $query);

        $from[] = '/int\(\d+\)/iU';
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

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

    constructor(props){
      super(props);

      this.state = {hasError: false};
      this.handleDrop = this.handleDrop.bind(this);
Severity: Major
Found in javascript/createInterface/StateDropDown.jsx and 1 other location - About 1 hr to fix
javascript/createInterface/InternationalDropDown.jsx on lines 5..10

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

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

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

    constructor(props){
      super(props);

      this.state = {hasError: false};
      this.handleDrop = this.handleDrop.bind(this);
Severity: Major
Found in javascript/createInterface/InternationalDropDown.jsx and 1 other location - About 1 hr to fix
javascript/createInterface/StateDropDown.jsx on lines 5..10

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

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 render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        return (
            <div className="col-md-5 col-md-offset-1">
                <br /><br /><br />
                <div className="panel panel-default">
Severity: Minor
Found in javascript/manager/Manager.jsx - About 1 hr to fix

Function searchListByDept has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    searchListByDept(e) {
        var dept = null;

        try {
            // Saves the dept that the user is looking for.
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 1 hr to fix

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

    render() {
        return (
            <div className="panel panel-default">
                <div className="panel-body">
                    <div className="row">
Severity: Minor
Found in javascript/editCourses/courseEditor.jsx - About 1 hr to fix

Function viewShowFilter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    viewShowFilter(data, filter) {
        var filtered = [];

        for (var i = 0; i < data.length; i++) {
            var item = data[i];
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 1 hr to fix

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

    public function get()
    {
        $id = $_REQUEST['id'];
        $type = $_REQUEST['type'];
        // If the document's id is set then we're downloading the file
Severity: Minor
Found in class/Command/DocumentRest.php - About 1 hr to fix

Method getTotalRows has 26 lines of code (exceeds 25 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

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

    protected function buildMessage()
    {
        $this->to = explode(',', $this->emailSettings->getExceptionEmail());
        $this->subject = 'Uncaught Exception';

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

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

    public static function getMessage($id) {
        if(is_null($id) || !isset($id)) {
            throw new \InvalidArgumentException('Host ID is required.');
        }

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

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

    public function addColumn($column, $max_min = null, $as = null, $count = false, $distinct = false, $coalesce = null)
    {

        /****
         * What is this for?
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix
Severity
Category
Status
Source
Language