metamaps/metamaps

View on GitHub
app/services/map_export_service.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for rdf is too high. [24.04/16]
Open

  def rdf
    output = ''
    output += "PREFIX d: <#{base_url}/maps/#{map.id}>\n"
    output += "PREFIX mm: <#{base_url}/owl/map.owl.ttl>\n"
    output += "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
Severity: Minor
Found in app/services/map_export_service.rb by rubocop

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. [18/10]
Open

  def exportable_topics
    visible_topics ||= Pundit.policy_scope!(user, map.topics)
    topic_mappings = Mapping.includes(mappable: %i[metacode user])
                            .where(mappable: visible_topics, map: map)
    topic_mappings.map do |mapping|
Severity: Minor
Found in app/services/map_export_service.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.

Assignment Branch Condition size for exportable_topics is too high. [23.37/16]
Open

  def exportable_topics
    visible_topics ||= Pundit.policy_scope!(user, map.topics)
    topic_mappings = Mapping.includes(mappable: %i[metacode user])
                            .where(mappable: visible_topics, map: map)
    topic_mappings.map do |mapping|
Severity: Minor
Found in app/services/map_export_service.rb by rubocop

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. [16/10]
Open

  def rdf
    output = ''
    output += "PREFIX d: <#{base_url}/maps/#{map.id}>\n"
    output += "PREFIX mm: <#{base_url}/owl/map.owl.ttl>\n"
    output += "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
Severity: Minor
Found in app/services/map_export_service.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.

Assignment Branch Condition size for to_spreadsheet is too high. [21.02/16]
Open

  def to_spreadsheet
    spreadsheet = []
    spreadsheet << ['Topics']
    spreadsheet << topic_headings.map(&:capitalize)
    exportable_topics.each do |topics|
Severity: Minor
Found in app/services/map_export_service.rb by rubocop

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. [13/10]
Open

  def to_spreadsheet
    spreadsheet = []
    spreadsheet << ['Topics']
    spreadsheet << topic_headings.map(&:capitalize)
    exportable_topics.each do |topics|
Severity: Minor
Found in app/services/map_export_service.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. [12/10]
Open

  def exportable_synapses
    visible_synapses = Pundit.policy_scope!(user, map.synapses)
    visible_synapses.map do |synapse|
      next nil if synapse.nil?
      OpenStruct.new(
Severity: Minor
Found in app/services/map_export_service.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.

There are no issues that match your filters.

Category
Status