AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

Function getLinkValues has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getLinkValues()
    {
        $output = null;
        if (isset($GLOBALS['DBPager_Link_Values'])) {
            return $GLOBALS['DBPager_Link_Values'];
Severity: Minor
Found in class/SubselectPager.php - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $this->subject = 'Internship Enrollment Issue';
        $this->to[] = $this->internship->email . $this->emailSettings->getEmailDomain();

Severity: Minor
Found in class/Email/RegistrationIssueEmail.php - About 2 hrs 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 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute()
    {
        /* Check if user should have access to Affiliate Agreement page */
        if(!\Current_User::allow('intern', 'affiliation_agreement')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliation Agreements.');
Severity: Major
Found in class/Command/SaveAffiliate.php - About 2 hrs to fix

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

    render() {
        var data = null
        var description = null
        if (this.state.mainData != null) {
            var onHidden = this.onHidden;
Severity: Major
Found in javascript/manager/Manager.jsx - About 2 hrs to fix

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

    public function execute() {
        // Check permissions
        if(!\Current_User::allow('intern', 'create_internship')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'You do not have permission to create new internships.');
            \NQ::close();
Severity: Major
Found in class/Command/AddInternship.php - About 2 hrs to fix

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

        if(this.state.errorWarning == null){
            errors = '';
        } else {
            errors = <ErrorMessagesBlock key="errorSet" errors={this.state.errorWarning} messageType={this.state.messageType} />
        }
Severity: Major
Found in javascript/editAdmin/editAdmin.jsx and 3 other locations - About 2 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 383..387
javascript/editTerms/EditTerms.jsx on lines 561..565
javascript/settings/settings.jsx on lines 113..117

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

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

        if (this.state.errorWarning == null) {
            errors = '';
        } else {
            errors = <ErrorMessagesBlock key="errorSet" errors={this.state.errorWarning} messageType={this.state.messageType} />
        }
Severity: Major
Found in javascript/editTerms/EditTerms.jsx and 3 other locations - About 2 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 383..387
javascript/editAdmin/editAdmin.jsx on lines 277..281
javascript/settings/settings.jsx on lines 113..117

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

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

        if(this.state.notification === null){
            errorSet = '';
        } else {
            errorSet = <ErrorMessagesBlock key="notification" notif={this.state.notification} stat={this.state.notificationStatus}/>
        }
Severity: Major
Found in javascript/settings/settings.jsx and 3 other locations - About 2 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 383..387
javascript/editAdmin/editAdmin.jsx on lines 277..281
javascript/editTerms/EditTerms.jsx on lines 561..565

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

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

        if (this.state.errorWarning == null){
            errors = '';
        } else {
            errors = <ErrorMessagesBlock key="errorSet" errors={this.state.errorWarning} messageType={this.state.messageType} />
        }
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 3 other locations - About 2 hrs to fix
javascript/editAdmin/editAdmin.jsx on lines 277..281
javascript/editTerms/EditTerms.jsx on lines 561..565
javascript/settings/settings.jsx on lines 113..117

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

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

            error: function(xhr, status, err) {
                var errorMessage = "Failed to add term.";
                console.error(this.props.url, status, err.toString());
                this.setState({errorWarning: errorMessage, messageType: "error"});
            }.bind(this)
Severity: Major
Found in javascript/editTerms/EditTerms.jsx and 1 other location - About 2 hrs to fix
javascript/editTerms/EditTerms.jsx on lines 520..524

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

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

            error: function(xhr, status, err) {
                var errorMessage = "Failed to update term.";
                console.error(this.props.url, status, err.toString());
                this.setState({errorWarning: errorMessage, messageType: "error"});
            }.bind(this)
Severity: Major
Found in javascript/editTerms/EditTerms.jsx and 1 other location - About 2 hrs to fix
javascript/editTerms/EditTerms.jsx on lines 485..489

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

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

    protected function plugStudentValues(&$student, \stdClass $data){
        /**********************
        * Basic Demographics *
        **********************/
        $student->setStudentId($data->bannerID);
Severity: Major
Found in class/DataProvider/Student/WebServiceDataProvider.php - About 2 hrs to fix

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

    public function getLinkValues()
    {
        $output = null;
        if (isset($GLOBALS['DBPager_Link_Values'])) {
            return $GLOBALS['DBPager_Link_Values'];
Severity: Major
Found in class/SubselectPager.php - About 2 hrs to fix

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

    public function execute()
    {
        /* Check if user should have access to Affiliate Agreement page */
        if(!\Current_User::allow('intern', 'affiliation_agreement')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliation Agreements.');
Severity: Minor
Found in class/Command/SaveAffiliate.php - About 2 hrs 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 post has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function post($contractDir, $otherDir, $affiliationDir)
    {
        // List of known types taken from fileca$target_dir = $otherDir;binet. Only these accepted, update list of accept more.
        $known_documents = array('csv', 'doc', 'docx', 'odt', 'pdf', 'ppt', 'pptx', 'rtf',
            'tar', 'tgz', 'txt', 'xls', 'xlsx', 'xml', 'zip', 'gz', 'rar', 'ods', 'odp');
Severity: Minor
Found in class/Command/DocumentRest.php - About 2 hrs 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 getCSV has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCSV()
    {
        // Initalize term description list, if needed
        // Store term list in a static var, so hopefully we only do this once per export
        if(!isset(self::$termDescriptionList)){
Severity: Minor
Found in class/Internship.php - About 2 hrs 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 addValue has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function addValue($column, $value = null)
    {
        if (is_array($column)) {
            foreach ($column as $colKey => $colVal) {
                $result = $this->addValue($colKey, $colVal);
Severity: Minor
Found in class/SubselectDatabase.php - About 2 hrs 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 render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var fgClasses = classNames({'form-group': true, 'has-error': this.state.hasError});

        var availHostOptions = null;
        if (this.state.availableHost != null) {
Severity: Major
Found in javascript/createInterface/HostBlock.jsx - About 2 hrs to fix

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

              <div className="col-sm-3">
                  <div className="form-group">
                      <label>Description: </label>
                      <input type="text" className="form-control" placeholder="Season 0 0000" ref="description"/>
                  </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 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>Graduate Overload Hours: </label>
                      <input type="text" className="form-control" placeholder="00" ref="grad_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 360..365

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

Severity
Category
Status
Source
Language