internetee/e_invoice

View on GitHub

Showing 28 of 28 total issues

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

def build_invoice_payment_details(invoice)
builder.PaymentInfo do
builder.Currency invoice.currency
builder.PaymentRefId invoice.reference_number
builder.PaymentDescription invoice.number
Severity: Minor
Found in lib/e_invoice/generator.rb - About 35 mins to fix

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

builder.LegalAddress do
builder.PostalAddress1 invoice.seller.legal_address.line1
builder.PostalAddress2 invoice.seller.legal_address.line2
builder.City invoice.seller.legal_address.city
builder.PostalCode invoice.seller.legal_address.postal_code
Severity: Minor
Found in lib/e_invoice/generator.rb and 1 other location - About 35 mins to fix
lib/e_invoice/generator.rb on lines 73..78

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

builder.LegalAddress do
builder.PostalAddress1 invoice.buyer.legal_address.line1
builder.PostalAddress2 invoice.buyer.legal_address.line2
builder.City invoice.buyer.legal_address.city
builder.PostalCode invoice.buyer.legal_address.postal_code
Severity: Minor
Found in lib/e_invoice/generator.rb and 1 other location - About 35 mins to fix
lib/e_invoice/generator.rb on lines 53..58

Replace class var @@deliveries with a class instance var.
Open

@@deliveries = []

Line is too long. [110/100]
Open

spec.email = ['artur.beljajev@internet.ee', 'maciej.szlosarczyk@internet.ee', 'sergei.tsoganov@internet.ee']
Severity: Minor
Found in estonian_e_invoice.gemspec by rubocop

unexpected token tLSHFT (Using Ruby 2.2 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

error_message = <<~TEXT.gsub("\n", "\s").strip
Severity: Minor
Found in lib/e_invoice/invoice.rb by rubocop

unexpected token tIDENTIFIER (Using Ruby 2.2 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

Delivery channel "#{channel}" is invalid.
Severity: Minor
Found in lib/e_invoice/invoice.rb by rubocop

Do not use prefix _ for a variable that is used.
Open

def deliver(_e_invoice)
Severity
Category
Status
Source
Language