ikuseiGmbH/smart-village-app-converter-xml2json

View on GitHub

Showing 8 of 24 total issues

File poi_record.rb has 340 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class PoiRecord < Record

  # Load poi data from external source
  # and save it to local attribute 'xml_data'
  #
Severity: Minor
Found in app/models/record/poi_record.rb - About 4 hrs to fix

    Class PoiRecord has 32 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class PoiRecord < Record
    
      # Load poi data from external source
      # and save it to local attribute 'xml_data'
      #
    Severity: Minor
    Found in app/models/record/poi_record.rb - About 4 hrs to fix

      Function exports has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(api) {
        var validEnv = ['development', 'test', 'production']
        var currentEnv = api.env()
        var isDevelopmentEnv = api.env('development')
        var isProductionEnv = api.env('production')
      Severity: Major
      Found in babel.config.js - About 3 hrs to fix

        Method weekday has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.weekday(day)
            return "" if day.blank?
        
            case day
            when "monday"
        Severity: Minor
        Found in app/services/translation.rb - About 1 hr to fix

          Method get_request has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            def get_request(content_type_xml = false, pem = nil, password = nil)
              uri = Addressable::URI.parse(@uri.strip).normalize
          
              uri.query = [uri.query, URI.encode_www_form(@params)].join("&") if @params && @params.any?
          
          
          Severity: Minor
          Found in app/services/api_request_service.rb - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method parse_media_content has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def parse_media_content(event)
              image_data = []
          
              if event.at_xpath("IMAGELINK_XL").try(:text).present?
                image_data << {
          Severity: Minor
          Found in app/models/record/event_record.rb - About 1 hr to fix

            Method get_request has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def get_request(content_type_xml = false, pem = nil, password = nil)
                uri = Addressable::URI.parse(@uri.strip).normalize
            
                uri.query = [uri.query, URI.encode_www_form(@params)].join("&") if @params && @params.any?
            
            
            Severity: Minor
            Found in app/services/api_request_service.rb - About 1 hr to fix

              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def initialize(uri, login = nil, password = nil, params = {}, headers = {})
              Severity: Minor
              Found in app/services/api_request_service.rb - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language