AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

class DocumentInfo extends React.Component{
    constructor(props) {
        super(props)
        this.state = {currentFiles: []}
        this.addFiles = this.addFiles.bind(this);
Severity: Major
Found in javascript/otherDocuments/OtherDocuments.jsx and 1 other location - About 1 wk to fix
javascript/affiliationAgreement/AffiliationUpload.jsx on lines 6..113

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

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

class AffiliationUploadInfo extends React.Component{
    constructor(props) {
        super(props)
        this.state = {currentFiles: []}
        this.addFiles = this.addFiles.bind(this);
Severity: Major
Found in javascript/affiliationAgreement/AffiliationUpload.jsx and 1 other location - About 1 wk to fix
javascript/otherDocuments/OtherDocuments.jsx on lines 6..113

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

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

File SubselectDatabase.php has 1892 lines of code (exceeds 250 allowed). 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/SubselectDatabase.php - About 5 days to fix

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/AffiliateDeptRest.php and 1 other location - About 2 days to fix
class/Command/AffiliateStateRest.php on lines 1..126

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

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/AffiliateStateRest.php and 1 other location - About 2 days to fix
class/Command/AffiliateDeptRest.php on lines 1..124

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

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

File ApproveHost.jsx has 993 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import {Button, Modal} from 'react-bootstrap';
import Message from '../emergencyContact/Message.jsx';
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx - About 2 days to fix

File SubselectPager.php has 982 lines of code (exceeds 250 allowed). 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/SubselectPager.php - About 2 days to fix

File createFakeStudents.php has 892 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/php
<?php
/**
 * This file is part of Internship Inventory.
 *
Severity: Major
Found in contrib/createFakeStudents.php - About 2 days to fix

SubselectDatabase has 105 functions (exceeds 20 allowed). Consider refactoring.
Open

class SubselectDatabase extends PHPWS_DB{

    public function __construct($table = null)
    {
        parent::__construct($table);
Severity: Major
Found in class/SubselectDatabase.php - About 2 days to fix

Internship has 87 functions (exceeds 20 allowed). Consider refactoring.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Major
Found in class/Internship.php - About 1 day to fix

Function execute has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute() {
        // We don't want to do certain things like state change or error checks if this is an ajax request.
        $isAjax = false;
        if(\Canopy\Request::isAjax()){
            $isAjax = true;
Severity: Minor
Found in class/Command/SaveInternship.php - About 1 day 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

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

                <div className="form-group">
                    <label className="col-lg-3 control-label" htmlFor="level">Level</label>
                    <div className="col-lg-8">
                        <div className="btn-group">
                            <label className={anyLevelClass}>Any Level
Severity: Major
Found in javascript/majorSelector/MajorSelector.jsx and 1 other location - About 1 day to fix
javascript/searchInterface/SearchInterface.jsx on lines 91..106

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

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

                <div className="form-group">
                  <label className="col-lg-3 control-label" htmlFor="location">Location</label>
                  <div className="col-lg-8">
                      <div className="btn-group">
                        <label className={anyLabelClass}>Any Location
Severity: Major
Found in javascript/searchInterface/SearchInterface.jsx and 1 other location - About 1 day to fix
javascript/majorSelector/MajorSelector.jsx on lines 88..103

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

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

File Internship.php has 624 lines of code (exceeds 250 allowed). 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/Internship.php - About 1 day to fix

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

    public function handleRequest()
    {
        // Check if it is time to add more term. If so, show a warning to admins.
        $futureTerms = TermFactory::getFutureTermsAssoc();
        if(sizeof($futureTerms) < 3 && \Current_User::isDeity()){
Severity: Major
Found in class/InternshipInventory.php - About 1 day to fix

Function handleRequest has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

    public function handleRequest()
    {
        // Check if it is time to add more term. If so, show a warning to admins.
        $futureTerms = TermFactory::getFutureTermsAssoc();
        if(sizeof($futureTerms) < 3 && \Current_User::isDeity()){
Severity: Minor
Found in class/InternshipInventory.php - About 1 day 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

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

                    <div className="col-md-3">
                        <label className="control-label">Filter</label> <br />
                        <div className="btn-group" data-toggle="buttons" onClick={this.onShow} value={this.state.value}>
                            <button className="btn btn-default" value="all">
                                <input  type="radio"/>All
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 1 other location - About 1 day to fix
javascript/specialHost/ApproveHost.jsx on lines 1006..1022

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

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

                    <div className="col-md-4">
                        <label className="control-label">Sort By</label> <br />
                        <div className="btn-group" data-toggle="buttons" onClick={this.onSortByChange} value={this.state.value}>
                            <button className="btn btn-default" value="subA">
                                <input  type="radio"/>Sub A-Z
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 1 day to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 436..452

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

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 getPageLinks has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPageLinks()
    {
        if ($this->total_pages < 1) {
            $current_page = $total_pages = 1;
        } else {
Severity: Minor
Found in class/SubselectPager.php - About 1 day 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

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

    public function execute() {
        // We don't want to do certain things like state change or error checks if this is an ajax request.
        $isAjax = false;
        if(\Canopy\Request::isAjax()){
            $isAjax = true;
Severity: Major
Found in class/Command/SaveInternship.php - About 1 day to fix
Severity
Category
Status
Source
Language