joffilyfe/hifpb

View on GitHub

Showing 10 of 10 total issues

Method import has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def import
response = request_suap_api({url: 'https://suap.ifpb.edu.br/edu/api/receber_cursos/',
data: course_params})
 
if response['erro'].nil?
Severity: Minor
Found in app/controllers/admin/courses_controller.rb - About 1 hr to fix

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

    def import
    response = request_suap_api({url: 'https://suap.ifpb.edu.br/edu/api/receber_cursos/',
    data: course_params})
     
    if response['erro'].nil?
    Severity: Minor
    Found in app/controllers/admin/courses_controller.rb - About 45 mins to fix

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

    def exist_other_with_this_name
    @schoolrooms = Schoolroom.all
    unless name.nil?
    @schoolrooms.each { |s|
    unless s.id == id
    Severity: Minor
    Found in app/models/schoolroom.rb - About 25 mins to fix

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

    def exist_other_with_this_name
    @laboratories = Laboratory.all
    unless name.nil?
    @laboratories.each { |l|
    unless l.id == id
    Severity: Minor
    Found in app/models/laboratory.rb - About 25 mins to fix

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

    def exist_other_with_this_initials
    @laboratories = Laboratory.all
    unless initials.nil?
    @laboratories.each { |l|
    unless l.id == id
    Severity: Minor
    Found in app/models/laboratory.rb - About 25 mins to fix

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

    def exist_other_with_this_initials
    @schoolrooms = Schoolroom.all
    unless initials.nil?
    @schoolrooms.each { |s|
    unless s.id == id
    Severity: Minor
    Found in app/models/schoolroom.rb - About 25 mins to fix

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

    def exist_other_with_this_name
    @laboratories = Laboratory.all
    unless name.nil?
    @laboratories.each { |l|
    unless l.id == id
    Severity: Minor
    Found in app/models/laboratory.rb and 3 other locations - About 20 mins to fix
    app/models/laboratory.rb on lines 10..15
    app/models/schoolroom.rb on lines 10..15
    app/models/schoolroom.rb on lines 21..26

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

    def exist_other_with_this_name
    @schoolrooms = Schoolroom.all
    unless name.nil?
    @schoolrooms.each { |s|
    unless s.id == id
    Severity: Minor
    Found in app/models/schoolroom.rb and 3 other locations - About 20 mins to fix
    app/models/laboratory.rb on lines 10..15
    app/models/laboratory.rb on lines 21..26
    app/models/schoolroom.rb on lines 10..15

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

    def exist_other_with_this_initials
    @laboratories = Laboratory.all
    unless initials.nil?
    @laboratories.each { |l|
    unless l.id == id
    Severity: Minor
    Found in app/models/laboratory.rb and 3 other locations - About 20 mins to fix
    app/models/laboratory.rb on lines 21..26
    app/models/schoolroom.rb on lines 10..15
    app/models/schoolroom.rb on lines 21..26

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

    def exist_other_with_this_initials
    @schoolrooms = Schoolroom.all
    unless initials.nil?
    @schoolrooms.each { |s|
    unless s.id == id
    Severity: Minor
    Found in app/models/schoolroom.rb and 3 other locations - About 20 mins to fix
    app/models/laboratory.rb on lines 10..15
    app/models/laboratory.rb on lines 21..26
    app/models/schoolroom.rb on lines 21..26
    Severity
    Category
    Status
    Source
    Language