calblueprint/bizworld

View on GitHub

Showing 102 of 102 total issues

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

        if (this.state.editable) {
            titleContainer = (
                <div>
                    <input type="text"
                        defaultValue={this.props.question.title}
app/assets/javascripts/components/classrooms/edit_classroom_questions.jsx on lines 159..173

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

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

AdminMCQuestion.propTypes = {
    question:       React.PropTypes.object.isRequired,
    saveCallback:   React.PropTypes.func.isRequired,
    deleteCallback: React.PropTypes.func.isRequired,
};
app/assets/javascripts/components/forms/additional_questions.jsx on lines 43..47
app/assets/javascripts/components/teachers/teachers.jsx on lines 58..62

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

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

TeacherModal.propTypes = {
    teacher_id : React.PropTypes.number.isRequired,
    program_id : React.PropTypes.string.isRequired,
    type       : React.PropTypes.string.isRequired
};
Severity: Major
Found in app/assets/javascripts/components/teachers/teachers.jsx and 2 other locations - About 1 hr to fix
app/assets/javascripts/components/forms/additional_questions.jsx on lines 43..47
app/assets/javascripts/components/forms/admin_questions.jsx on lines 219..223

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

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

  render() {
    return (
      <div className="onboarding-container">
        <div className="onboarding-overlay"></div>
        <div className="modal fade" id="onboarding-modal" tabIndex={-1}
Severity: Minor
Found in app/assets/javascripts/components/classrooms/classroom_onboard.jsx - About 1 hr to fix

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

        render() {
            const spanClass = "fa " + (this.state.submit ?  "fa-check-circle-o" : "fa-upload");
            return (
                <div>
                    <div className="modal-body">
    Severity: Minor
    Found in app/assets/javascripts/components/classrooms/upload_roster.jsx - About 1 hr to fix

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

                          <div className="edit-classroom-questions-header-container">
                              <h4>Edit Classroom Additional Info Questions</h4>
                              <input type="button" value="New Question"
                                          className="button-small submit-button"
                                          onClick={this._createNewQuestion} />
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 32..37
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 45..50
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 51..56
      app/assets/javascripts/components/classrooms/create_student.jsx on lines 45..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 64.

      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

                                      <fieldset className="input-container name-container">
                                          <label>Last name</label>
                                          <input type="text" placeholder="Last Name" name="last_name" onChange={this._handleChange} />
                                      </fieldset>
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 32..37
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 45..50
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 51..56
      app/assets/javascripts/components/classrooms/edit_classroom_questions.jsx on lines 60..65

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

      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

                    <fieldset className="input-container">
                        <label>Confirm new password</label>
                        <input type="password" ref="password_confirmation"
                            name="password_confirmation"
                            onChange={this._handleChange} />
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 32..37
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 45..50
      app/assets/javascripts/components/classrooms/create_student.jsx on lines 45..48
      app/assets/javascripts/components/classrooms/edit_classroom_questions.jsx on lines 60..65

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

      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

                      <fieldset className="input-container">
                          <label>Current password</label>
                          <input type="password" ref="old_password"
                              name="old_password"
                              onChange={this._handleChange} />
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 45..50
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 51..56
      app/assets/javascripts/components/classrooms/create_student.jsx on lines 45..48
      app/assets/javascripts/components/classrooms/edit_classroom_questions.jsx on lines 60..65

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

      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

                    <fieldset className="input-container">
                        <label>New password</label>
                        <input type="password" ref="new_password"
                            name="password"
                            onChange={this._handleChange} />
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 32..37
      app/assets/javascripts/components/authentication/change_password_form.jsx on lines 51..56
      app/assets/javascripts/components/classrooms/create_student.jsx on lines 45..48
      app/assets/javascripts/components/classrooms/edit_classroom_questions.jsx on lines 60..65

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

      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

          _saveQuestion = (e) => {
              e.stopPropagation();
              e.preventDefault();
              this.props.saveCallback(this.props.index, this.state.question);
          }
      Severity: Major
      Found in app/assets/javascripts/templates/default_question.jsx and 1 other location - About 1 hr to fix
      app/assets/javascripts/templates/default_question.jsx on lines 77..81

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

      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

      AdminInputQuestion.propTypes = {
          question:       React.PropTypes.object.isRequired,
          saveCallback:   React.PropTypes.func.isRequired,
          deleteCallback: React.PropTypes.func.isRequired,
      };
      Severity: Major
      Found in app/assets/javascripts/components/forms/admin_questions.jsx and 1 other location - About 1 hr to fix
      app/assets/javascripts/components/classrooms/class_info.jsx on lines 132..136

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

      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

          _deleteQuestion = (e) => {
              e.stopPropagation();
              e.preventDefault();
              this.props.deleteCallback(this.props.index, this.state.question);
          }
      Severity: Major
      Found in app/assets/javascripts/templates/default_question.jsx and 1 other location - About 1 hr to fix
      app/assets/javascripts/templates/default_question.jsx on lines 71..75

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

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

          render() {
              return (
                  <div className="action-item delete-item">
                      <button data-toggle="modal" data-target="#removeClassroomModal"
                          className="button button-small delete-button">
      Severity: Minor
      Found in app/assets/javascripts/components/classrooms/delete_classroom.jsx - About 1 hr to fix

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

        ClassInfo.propTypes = {
            classroom : React.PropTypes.object.isRequired,
            success   : React.PropTypes.func.isRequired,
            isAdmin   : React.PropTypes.bool.isRequired
        };
        Severity: Major
        Found in app/assets/javascripts/components/classrooms/class_info.jsx and 1 other location - About 1 hr to fix
        app/assets/javascripts/components/forms/admin_questions.jsx on lines 252..256

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

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

            render() {
                return (
                    <div className="action-item create-item">
                        <div data-toggle="modal" data-target="#newStudentModal" >
                            <button onClick={this._focusInputField} type="button" className="student-card add-card submit-button-o button-small">
        Severity: Minor
        Found in app/assets/javascripts/components/classrooms/create_student.jsx - About 1 hr to fix

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

                                      <div className="info-data">
                                          <a href={this._getFormLink(this.state.program.post_id)} target="_blank">
                                              Post-Assessment
                                          </a>
                                      </div>
          Severity: Major
          Found in app/assets/javascripts/components/admins/program_info.jsx and 2 other locations - About 1 hr to fix
          app/assets/javascripts/components/admins/program_info.jsx on lines 58..62
          app/assets/javascripts/components/admins/program_info.jsx on lines 68..72

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

                                      <div className="info-data">
                                          <a href={this._getFormLink(this.state.program.pre_id)} target="_blank">
                                              Pre-Assessment
                                          </a>
                                      </div>
          Severity: Major
          Found in app/assets/javascripts/components/admins/program_info.jsx and 2 other locations - About 1 hr to fix
          app/assets/javascripts/components/admins/program_info.jsx on lines 63..67
          app/assets/javascripts/components/admins/program_info.jsx on lines 68..72

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

                                      <div className="info-data">
                                          <a href={this._getFormLink(this.state.program.additional_id)} target="_blank">
                                              Classroom Questions
                                          </a>
                                      </div>
          Severity: Major
          Found in app/assets/javascripts/components/admins/program_info.jsx and 2 other locations - About 1 hr to fix
          app/assets/javascripts/components/admins/program_info.jsx on lines 58..62
          app/assets/javascripts/components/admins/program_info.jsx on lines 63..67

          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

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

              render() {
                  var old_password = <div></div>;
                  if (this.props.reset_token == null) {
                      old_password = (
                          <fieldset className="input-container">
            Severity
            Category
            Status
            Source
            Language