calblueprint/bizworld

View on GitHub

Showing 24 of 102 total issues

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

    render() {
        let classrooms;
        let spinner;
        if (this.state.isLoading) {
            spinner = (
Severity: Major
Found in app/assets/javascripts/components/admins/classrooms_table.jsx - About 3 hrs to fix

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

        render() {
            const deleteButton = (
                <DeleteClassroomModal classroom_id = { this.state.classroom.id } />
            );
    
    
    Severity: Major
    Found in app/assets/javascripts/components/classrooms/class_info.jsx - About 2 hrs to fix

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

          render() {
              return (
                  <div className="card-col">
                    <div type="button" className="add-course">
                        <div data-toggle="modal" data-target="#newClassroomModal" >
      Severity: Minor
      Found in app/assets/javascripts/components/teachers/create_classroom.jsx - About 1 hr to fix

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

            render() {
                let emptyState;
                if (this.state.students.length == 0) {
                    emptyState = (
                        <div className="empty-table-container">
        Severity: Minor
        Found in app/assets/javascripts/components/classrooms/students_table.jsx - About 1 hr to fix

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

              render() {
                  deactivate_button_value = this.state.program.is_active ? "Deactivate Program" : "Activate Program";
          
                  const programType = `program-${this.state.program.id}`;
                  return (
          Severity: Minor
          Found in app/assets/javascripts/components/admins/program_info.jsx - About 1 hr to fix

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

                render() {
                    let radioValue;
                    const uniqueId = `${this.props.name}_${this.props.value}`;
                    if (this.props.editable) {
                        radioValue = (
            Severity: Minor
            Found in app/assets/javascripts/components/forms/editable_radio.jsx - About 1 hr to fix

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

                  render() {
                      const radioOptions = this.state.question.options.map((option, index) => {
                          const checked = (this.state.question.answer == index);
                          return (
                              <div className="input-container" key={`input_${this.props.question.id}_${index}`}>
              Severity: Minor
              Found in app/assets/javascripts/components/forms/admin_questions.jsx - About 1 hr to fix

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

                    render() {
                        return (
                            <div className="card-col">
                              <div type="button" className="add-course">
                                  <div data-toggle="modal" data-target="#newProgramModal" >
                Severity: Minor
                Found in app/assets/javascripts/components/admins/create_program.jsx - About 1 hr to fix

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

                      render() {
                          return (
                              <div>
                                  <div className="login-title">
                                      <span className="fa fa-angle-left back"
                  Severity: Minor
                  Found in app/assets/javascripts/components/authentication/register.jsx - About 1 hr to fix

                    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

                        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

                          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

                            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">

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

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

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

                                    render() {
                                        let inputVal;
                                        if (this.props.editable) {
                                            inputVal = (
                                                <input name={this.props.name} type="text"
                                Severity: Minor
                                Found in app/assets/javascripts/components/common/editable_input.jsx - About 1 hr to fix

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

                                      render() {
                                          const questions = this.state.questions.map((question) => {
                                              return <AdminAdditionalInfoQuestion question  = {question}
                                                                           key       = {question.id}
                                                                           success   = {this._fetchQuestions} />

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

                                        render() {
                                            return (
                                                <div>
                                                    <div className="login-title">
                                                        <h1>Educator Portal</h1>
                                    Severity: Minor
                                    Found in app/assets/javascripts/components/authentication/login.jsx - About 1 hr to fix

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

                                        render() {
                                          let classpage, onboard;
                                      
                                          if (this.props.onboarding && !this.props.isAdmin) {
                                            onboard = <ClassroomOnboard teacher_id = {this.props.teacher_id} />
                                      Severity: Minor
                                      Found in app/assets/javascripts/components/classrooms/classroom_page.jsx - About 1 hr to fix

                                        Method update_question has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def update_question(question)
                                              question.options = params[:options].reject(&:empty?) if params.key?(:options)
                                              if params.key?(:answer)
                                                question.answer = (params[:answer] == '-1') ? nil : params[:answer]
                                              end
                                        Severity: Minor
                                        Found in app/controllers/api/questions_controller.rb - About 35 mins 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