KyivKrishnaAcademy/ved_akadem_students

View on GitHub

Showing 31 of 64 total issues

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

  render() {
    const {
      data: { people, defaultPhoto, localization, selectedPersonIndex },
      actions: { nextPerson, previousPerson },
    } = this.props;

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

      render() {
        const {
          data: { people, loading, editStudentProfileId, examinations, localization, editExaminationId },
        } = this.props;
    
    

      Class Person has 26 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Person < ApplicationRecord
        include Ilikable
      
        class SymbolWrapper
          def self.load(string)
      Severity: Minor
      Found in app/models/person.rb - About 3 hrs to fix

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

          render() {
            const {
              people,
              loading,
              canManage,
        Severity: Major
        Found in client/app/bundles/group-attendance/containers/group-attendance.jsx - About 2 hrs to fix

          File advanced-search.jsx has 255 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import qs from 'qs';
          import pipe from 'pipe-functions';
          import React, { PropTypes } from 'react';
          
          import bindAll from '../../../lib/helpers/bind-all';
          Severity: Minor
          Found in client/app/bundles/advanced-search/containers/advanced-search.jsx - About 2 hrs to fix

            Function _shownFilters has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _shownFilters() {
                const searchState = this.state.search;
                const configs = this.props.filters;
            
                // Skipping gaps in the ids series
            Severity: Major
            Found in client/app/bundles/advanced-search/containers/advanced-search.jsx - About 2 hrs to fix

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

                render() {
                  const { dispatch, groupPerformanceStore } = this.props;
                  const actions = bindActionCreators(groupPerformanceActionCreators, dispatch);
                  const {
                    people,
              Severity: Major
              Found in client/app/bundles/group-performance/containers/group-performance.jsx - About 2 hrs to fix

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

                  _initDefaultFilters(state) {
                    const config = this.props.filters;
                    const searchQuery = state.urlQuery.search || [];
                    const searchState = {};
                    const firstValues = Object.fromEntries(
                Severity: Minor
                Found in client/app/bundles/advanced-search/containers/advanced-search.jsx - About 1 hr to fix

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

                  export default function groupPerformanceReducer(state = initialState, action) {
                    switch (action.type) {
                      case actionTypes.SHOW_LOADER:
                        return {
                          ...state,

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

                      render() {
                        const {
                          canManage,
                          peopleIds,
                          examination,
                    Severity: Minor
                    Found in client/app/bundles/group-performance/components/performance-row.jsx - About 1 hr to fix

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

                      export default function groupAttendanceReducer(state = initialState, action) {
                        switch (action.type) {
                          case actionTypes.OPEN_ATTENDANCE_SUBMITTER:
                            return {
                              ...state,

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

                          render() {
                            const {
                              people,
                              loading,
                              canManage,

                          Method current_path? has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def current_path?(uri, options = {})
                              unless request
                                raise "You cannot use helpers that need to determine the current "                  "page unless your view context provides a Request object "                  "in a #request method"
                              end
                          
                          
                          Severity: Minor
                          Found in app/helpers/concerns/current_page.rb - 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 render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            render() {
                              const { people, loading, canManage, classSchedules, getAttendance, openAttendanceSubmitter } = this.props;
                          
                              const peopleIds = people.map(person => person.studentProfileId);
                              const peopleNames = people.map(person =>

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

                              render() {
                                const { peopleIds, classSchedules } = this.props;
                            
                                const statsticsCells = [];
                            
                            
                            Severity: Minor
                            Found in client/app/bundles/group-attendance/components/statistics-row.jsx - About 1 hr to fix

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

                                render() {
                                  const onTimeSelect = direction => () => this._updateSchedules(1, direction);
                                  const timeSelector = (
                                    <div className="col-xs-12 vert-offset-bottom-1">
                                      <TimesSelector
                              Severity: Minor
                              Found in client/app/bundles/ScheduleList/containers/ScheduleList.jsx - About 1 hr to fix

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

                                  render() {
                                    const { canManage, peopleIds, classSchedule: { date, courseTitle, attendances } } = this.props;
                                
                                    let presenceCount = 0;
                                    const attendanceMarkers = [];
                                Severity: Minor
                                Found in client/app/bundles/group-attendance/components/attendance-row.jsx - About 1 hr to fix

                                  Method certificate_template_params has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def certificate_template_params
                                      params
                                        .require(:certificate_template)
                                        .permit(
                                          :title,
                                  Severity: Minor
                                  Found in app/controllers/certificate_templates_controller.rb - About 1 hr to fix

                                    Method update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def update
                                          self.resource = resource_get
                                          prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)
                                    
                                          resource_updated = update_resource(resource, account_update_params)
                                    Severity: Minor
                                    Found in app/controllers/users/registrations_controller.rb - About 55 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

                                    Method set_complex_name has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      def set_complex_name
                                        civil_name = "#{surname} #{name}#{middle_name.present? ? ' ' << middle_name : ''}"
                                    
                                        self.complex_name = if diploma_name.present?
                                          if surname.present? && name.present?
                                    Severity: Minor
                                    Found in app/models/person.rb - About 45 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