fga-gpp-mds/2017.1-Escola-X

View on GitHub

Showing 3,213 of 3,213 total issues

Method has too many lines. [12/10]
Open

  def post_grades
    if is_secretary?
      @classroom = Classroom.find(params[:id])
      @subject = Subject.find(params[:subject_id])
      @alumn = Alumn.find(params[:alumn_id])

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [12/10]
Open

  def create
    if ( is_principal? )
      @shifts = Shift.all
      @teacher = Teacher.new(teacher_params)
      if (@teacher.save)

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [12/10]
Open

  def teacher_params
    params.require(:teacher).permit(:registry,
                                   :admission_date,
                                   :employee_cpf,
                                   :shift,

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [12/10]
Open

  def update
    if ( is_principal? )
      @shifts = Shift.all
      @teacher = Teacher.find(params[:id])
      if ( @teacher.update(teacher_params) )

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for create is too high. [17.03/15]
Open

  def create
      if ( is_principal? )
            @classroom_grades = ClassroomGrade.all
            @subject = Subject.new(subject_params)
            @teacher = Teacher.find_by_registry(params[:teacher_registry])

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [11/10]
Open

  def create
    if ( is_employee? )
      @school_miss = SchoolMiss.new(school_miss_params)
      @school_miss.alumn_id = Alumn.current.id
      if ( @school_miss.save )

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for destroy is too high. [4/3]
Open

  def destroy
    if ( is_employee? )
      @strike = Strike.find(params[:id])
      @alumn = Alumn.find_by_id(@strike.alumn_id)
      if @strike.destroy

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Cyclomatic complexity for add_alumn is too high. [4/3]
Open

def add_alumn
  if ( is_principal? )
    @classroom = Classroom.find(params[:id])
    @alumns = @classroom.alumns
    @alumn = Alumn.find_by_registry(params[:registry])

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Cyclomatic complexity for index is too high. [4/3]
Open

  def index
    id = params[:alumn_id]

    if ( is_employee? or verify_alumn(id) or is_son?(id) )
      @@alumn = Alumn.find(id)

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Cyclomatic complexity for show is too high. [4/3]
Open

  def show
    id = params[:id]

    if ( is_employee? or verify_parent(id) or is_related?(id) )
      @parent = Parent.find(id)

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [11/10]
Open

  def update
    if ( is_principal? )
      @parent = Parent.find(params[:id])
      if ( @parent.update(parent_params) )
        flash[:notice] = "Responsável alterado(a) com sucesso"

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for create is too high. [4/3]
Open

  def create
    if ( is_employee? )
      @strike = @@alumn.strikes.create(strike_params)
      @strike.employee_id = @current_user.id
      if (@strike.save)

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [11/10]
Open

    def mountCurrentDate() 
    
         #hour = (Time.current.hour - ADJUSTING_FUSE_TO_BRAZILIAN).to_s
         #minute = Time.current.min .to_s
         day = Time.current.day.to_s
Severity: Minor
Found in app/helpers/reader_helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

  def update
    if ( is_employee? )
      @strike = Strike.find(params[:id])
      if @strike.update(strike_params)
        flash[:notice] = "Advertência alterada com sucesso"

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

  def create
    if ( is_principal? )
      @parent = Parent.new(parent_params)

      if (@parent.save)

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for create is too high. [4/3]
Open

    def create
        if( is_principal? )
            @suspension = @@alumn.suspensions.create(suspension_params)
            @suspension.employee_id = @current_user.id
            if( @suspension.save )

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Cyclomatic complexity for report is too high. [4/3]
Open

  def report
      @alumn = Alumn.find(params[:id])
      if ( !(is_parent_related_to_alumn?(@alumn) or is_me?(@alumn) or is_principal?) )
        redirect_to @current_user
      end

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [11/10]
Open

    def mountCurrentDate() 
    
         #hour = (Time.current.hour - ADJUSTING_FUSE_TO_BRAZILIAN).to_s
         #minute = Time.current.min .to_s
         day = Time.current.day.to_s

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

  def employee_params
    params.require(:employee).permit(    :registry,
                                                                            :admission_date,
                                                                            :employee_cpf,
                                                                            :shift,

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for destroy is too high. [4/3]
Open

    def destroy
        if( is_principal? )
            @suspension = Suspension.find(params[:id])
            @alumn = Alumn.find_by_id(@suspension.alumn_id)
            if( @suspension.destroy )

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Severity
Category
Status
Source
Language