KyivKrishnaAcademy/ved_akadem_students

View on GitHub

Showing 31 of 64 total issues

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

Method link_to_action has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def link_to_action(condition, path, btn_color, tooltip, icon, params = {})
Severity: Minor
Found in app/helpers/concerns/link_tos.rb - About 45 mins to fix

    Function createResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function createResult(examinationId, studentProfileId, score, success, error) {

      Method generate_menu_group has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def generate_menu_group(name, plural_name, icon, options = {}, &block)
      Severity: Minor
      Found in app/helpers/concerns/auto_generated_menu.rb - About 35 mins to fix

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

          def self.call(string)
            result_object =
              string
                .split("\n")
                .each_with_object(init_new_acc) do |substring, acc|
        Severity: Minor
        Found in app/services/remove_uploaders_from_model_yaml_dump_service.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

        Function groupAttendanceReducer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

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

        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 AttendanceMarker has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const AttendanceMarker = ({ inSync, presence }) => {
          const spinner = <span className="glyphicon glyphicon-refresh" aria-hidden="true" />;
        
          if (presence === true) return <div className="cell bg-success">{inSync ? spinner : '.'}</div>;
          if (presence === false) return <div className="cell bg-danger">{inSync ? spinner : 'н'}</div>;
        Severity: Minor
        Found in client/app/bundles/group-attendance/components/attendance-marker.jsx - 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

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

          def self.call(version)
            prev_version_attributes = prev_attributes(version)
            next_version_attributes = next_attributes(version)
        
            if prev_version_attributes.empty? || next_version_attributes.empty?
        Severity: Minor
        Found in app/services/get_version_changes_service.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

        Method common_handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def common_handle(study_application, method)
            authorize study_application
        
            operation_result = method == :create ? study_application.save : study_application.destroy.destroyed?
        
        
        Severity: Minor
        Found in app/controllers/study_applications_controller.rb - About 25 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 show? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def show?
              if record.is_a?(PaperTrail::Version)
                object = record.reify || record.item || record.next&.reify
                policy = Pundit.policy(user, object)
        
        
        Severity: Minor
        Found in app/policies/paper_trail/version_policy.rb - About 25 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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def update
            authorize @questionnaire, :save_answers?
        
            set_questions
        
        
        Severity: Minor
        Found in app/controllers/answers_controller.rb - About 25 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