berkmancenter/lumendatabase

View on GitHub

Showing 47 of 47 total issues

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

original_urls = parsed_original_urls.map do |url|
uri = URI.parse(url)
valid = %w(http https).include?(uri.scheme)
unless valid
url = "https://#{url}"
Severity: Minor
Found in lib/yt_importer/mapping/base.rb and 1 other location - About 20 mins to fix
lib/yt_importer/mapping/base.rb on lines 151..158

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

infringing_urls = parsed_infringing_urls.map do |url|
uri = URI.parse(url)
valid = %w(http https).include?(uri.scheme)
unless valid
url = "https://#{url}"
Severity: Minor
Found in lib/yt_importer/mapping/base.rb and 1 other location - About 20 mins to fix
lib/yt_importer/mapping/base.rb on lines 161..168

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

def principal
behalf_client = get_single_line_field('behalf_client')
legal_name = get_single_line_field('Fulllegalname')
 
name = legal_name if legal_name.present?
Severity: Minor
Found in lib/yt_importer/mapping/plain_new/defamation.rb and 2 other locations - About 15 mins to fix
lib/yt_importer/mapping/plain_new/counterfeit.rb on lines 29..38
lib/yt_importer/mapping/plain_new/other_legal.rb on lines 58..67

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

def sender
full_legal_name = get_single_line_field('Fulllegalname')
company_name = get_single_line_field('CompanyName')
 
name = full_legal_name if full_legal_name.present?
Severity: Minor
Found in lib/yt_importer/mapping/plain_new/counterfeit.rb and 2 other locations - About 15 mins to fix
lib/yt_importer/mapping/plain_new/defamation.rb on lines 56..65
lib/yt_importer/mapping/plain_new/other_legal.rb on lines 58..67

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

def principal
behalf_client = get_single_line_field('client')
legal_name = get_single_line_field('Fulllegalname')
 
name = legal_name if legal_name.present?
Severity: Minor
Found in lib/yt_importer/mapping/plain_new/other_legal.rb and 2 other locations - About 15 mins to fix
lib/yt_importer/mapping/plain_new/counterfeit.rb on lines 29..38
lib/yt_importer/mapping/plain_new/defamation.rb on lines 56..65

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

validates :date_sent, date: { after: Proc.new { Date.new(1998,10,28) }, before: Proc.new { Time.now + 1.day }, allow_blank: true }
validates :date_received, date: { after: Proc.new { Date.new(1998,10,28) }, before: Proc.new { Time.now + 1.day }, allow_blank: true }
Severity: Minor
Found in app/models/notice.rb and 1 other location - About 15 mins to fix
app/models/notice.rb on lines 135..137

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

validates :date_received, date: { after: Proc.new { Date.new(1998,10,28) }, before: Proc.new { Time.now + 1.day }, allow_blank: true }
 
# == Callbacks ============================================================
Severity: Minor
Found in app/models/notice.rb and 1 other location - About 15 mins to fix
app/models/notice.rb on lines 134..135
Severity
Category
Status
Source
Language