AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

              <div className="col-sm-3">
                  <div className="form-group">
                      <label>Undergraduate Overload Hours: </label>
                      <input type="text" className="form-control" placeholder="00" ref="undergrad_overload"/>
                  </div>
Severity: Major
Found in javascript/editTerms/EditTerms.jsx and 4 other locations - About 2 hrs to fix
javascript/editTerms/EditTerms.jsx on lines 290..295
javascript/editTerms/EditTerms.jsx on lines 297..302
javascript/editTerms/EditTerms.jsx on lines 304..309
javascript/editTerms/EditTerms.jsx on lines 371..376

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

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 5 locations. Consider refactoring.
Open

              <div className="col-sm-3">
                  <div className="form-group">
                      <label>Term Code: </label>
                      <input type="text" className="form-control" placeholder="000000" ref="term_code"/>
                  </div>
Severity: Major
Found in javascript/editTerms/EditTerms.jsx and 4 other locations - About 2 hrs to fix
javascript/editTerms/EditTerms.jsx on lines 297..302
javascript/editTerms/EditTerms.jsx on lines 304..309
javascript/editTerms/EditTerms.jsx on lines 360..365
javascript/editTerms/EditTerms.jsx on lines 371..376

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

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 5 locations. Consider refactoring.
Open

              <div className="col-sm-3">
                  <div className="form-group">
                      <label>Semester Type: </label>
                      <input type="text" className="form-control" placeholder="0" ref="sem_type"/>
                  </div>
Severity: Major
Found in javascript/editTerms/EditTerms.jsx and 4 other locations - About 2 hrs to fix
javascript/editTerms/EditTerms.jsx on lines 290..295
javascript/editTerms/EditTerms.jsx on lines 304..309
javascript/editTerms/EditTerms.jsx on lines 360..365
javascript/editTerms/EditTerms.jsx on lines 371..376

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

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

    render() {
        var conData = null;
        if (this.props.conditionData != null) {
            conData = this.props.conditionData.map(function (condition) {
            return (
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 2 hrs to fix

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

    public function post()
    {
        $user = $_REQUEST['user'];
        $dept = $_REQUEST['dept'];

Severity: Minor
Found in class/Command/AdminRest.php - About 2 hrs to fix

Function render has 50 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/editLevel/editLevel.jsx - About 2 hrs to fix

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

            error: function(http) {
                var errorMessage = http.responseText;
                this.setState({errorWarning: errorMessage});
                $("#warningError").show();
                $("#success").hide();
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 2 hrs to fix
javascript/editLevel/editLevel.jsx on lines 163..168

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

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

function road()
{
    $roads = array(
        'Elm',
        'Cactus',
Severity: Minor
Found in contrib/createFakeStudents.php - About 2 hrs to fix

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

            error: function(http) {
                var errorMessage = http.responseText;
                this.setState({errorWarning: errorMessage});
                $("#warningError").show();
                $("#success").hide();
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 2 hrs to fix
javascript/editLevel/editLevel.jsx on lines 184..189

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

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

    render() {
        var data = null;
        if (this.state.mainData != null) {
            var onSave = this.onSave;
            data = this.state.mainData.map(function (data) {
Severity: Minor
Found in javascript/editLevel/editLevel.jsx - About 1 hr to fix

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

function process($arguments)
{
    $dump_data = false;

    array_shift($arguments);
Severity: Minor
Found in contrib/createFakeStudents.php - About 1 hr to fix

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

    public function execute() {
        /* Check if user should have access to Host page */
        if(!\Current_User::isLogged()){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to view Hosts.');
            throw new \Intern\Exception\PermissionException('You do not have permission to view Hosts.');
Severity: Major
Found in class/Command/SubRest.php and 2 other locations - About 1 hr to fix
class/Command/ConditionRest.php on lines 26..48
class/Command/HostRest.php on lines 29..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 120.

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 3 locations. Consider refactoring.
Open

    public function execute() {
        /* Check if user should have access to Host page */
        if(!\Current_User::isLogged()){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to view Hosts.');
            throw new \Intern\Exception\PermissionException('You do not have permission to view Hosts.');
Severity: Major
Found in class/Command/ConditionRest.php and 2 other locations - About 1 hr to fix
class/Command/HostRest.php on lines 29..51
class/Command/SubRest.php on lines 26..48

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

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 3 locations. Consider refactoring.
Open

    public function execute() {
        /* Check if user should have access to Host page */
        if(!\Current_User::isLogged()){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to view Hosts.');
            throw new \Intern\Exception\PermissionException('You do not have permission to view Hosts.');
Severity: Major
Found in class/Command/HostRest.php and 2 other locations - About 1 hr to fix
class/Command/ConditionRest.php on lines 26..48
class/Command/SubRest.php on lines 26..48

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

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

    render() {

        // If we have no data, and it's still loading, then return an empty div
        if(this.state.terms === null && this.state.dataLoading === true){
            return (<div></div>);
Severity: Minor
Found in javascript/createInterface/TermBlock.jsx - About 1 hr to fix

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

    render() {

        var dropdown;
        if(!this.state.domestic && !this.state.international) {
            dropdown = '';
Severity: Minor
Found in javascript/searchInterface/SearchInterface.jsx - About 1 hr to fix

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

    public function execute()
    {
        // Get the list of future terms
        $terms = TermFactory::getFutureTermsAssoc();

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

Function viewShowFilter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    viewShowFilter(data, filter) {
        var filtered = [];
        for (var i = 0; i < data.length; i++) {
            var item = data[i];
            if (filter === 'condition') {
Severity: Minor
Found in javascript/specialHost/ApproveHost.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 processArgs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function processArgs($argc, $argv, &$args, &$switches)
{
    if($argc < count(array_keys($args)) + 1) {
        echo "USAGE: php {$argv[0]}";

Severity: Minor
Found in cli.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 generatePdf has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function generatePdf()
    {
        $this->pdf = new \setasign\Fpdi\Fpdi('P', 'mm', 'Letter');
        $h = $this->internship->getHost();
        $s = $this->internship->getSupervisor();
Severity: Minor
Found in class/InternshipContractPdfView.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

Severity
Category
Status
Source
Language