Showing 31 of 31 total issues
Method parse
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def parse(filename=nil)
self.clear # Needed if you parse multiple times
@messages = []
@valid = false
- Read upRead up
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 download
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def self.download(username, password, archive, log, days=20)
log.debug "Starting download of Argos XML to #{archive}"
soap = Argos::Soap.new({username: username, password: password})
- Read upRead up
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
Class Soap
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Soap
# A [simple](http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/) Soap client for the Argos satellite tracking webservice operated by CLS
# client [Savon] (version 3)
Method initialize
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(argv=ARGV, param = PARAM)
@param = param
option_parser = OptionParser.new(argv) do |opts|
Method parse
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(filename=nil)
self.clear # Needed if you parse multiple times
@messages = []
@valid = false
Method download
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.download(username, password, archive, log, days=20)
log.debug "Starting download of Argos XML to #{archive}"
soap = Argos::Soap.new({username: username, password: password})
File soap.rb
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "savon"
module Argos
class Soap
Method parse
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(filename=nil)
if filename.nil?
filename = @filename
end
File ds.rb
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Argos
# Argos DS|DAT file parser
#
# Usage
Method combine_header_with_transmission
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def combine_header_with_transmission(measurements, header)
unless header.is_a? Array
header = header.split(" ")
end
latitude = longitude = positioned = nil
- Read upRead up
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 create_diag_hash
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_diag_hash(contact="")
platform = contact[/^(\d{5,})/,1]
location_data = contact[/Date : (\d{2}.\d{2}.\d{2} \d{2}:\d{2}:\d{2})/,1]
contact_time = convert_date(location_data) unless location_data ==nil
lc = contact[/LC : (3|2|1|0|A|B|Z)/,1]
Method combine_header_with_transmission
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def combine_header_with_transmission(measurements, header)
unless header.is_a? Array
header = header.split(" ")
end
latitude = longitude = positioned = nil
Class Ds
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Ds < Array
include Argos::Ascii
attr_writer :log, :filename, :bundle
Method parse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse(filename=nil)
if filename.nil?
filename = @filename
end
- Read upRead up
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 initialize
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def initialize(argv=ARGV, param = PARAM)
@param = param
option_parser = OptionParser.new(argv) do |opts|
- Read upRead up
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 sensor_data=
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def sensor_data=(sensor_data)
# Hex string?
if sensor_data.is_a? String
bytes = (sensor_data.size/2)
- Read upRead up
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 run
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
begin
@soap = Argos::Soap.new(param)
@result = nil
Method source
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.source(argos)
argos.parse(argos.filename)
latitude_mean = longitude_mean = nil
Method create_diag_hash
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create_diag_hash(contact="")
platform = contact[/^(\d{5,})/,1]
location_data = contact[/Date : (\d{2}.\d{2}.\d{2} \d{2}:\d{2}:\d{2})/,1]
contact_time = convert_date(location_data) unless location_data ==nil
lc = contact[/LC : (3|2|1|0|A|B|Z)/,1]
- Read upRead up
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 _call_xml_operation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _call_xml_operation(op_sym, body, extract=nil)
@operation = _operation(op_sym)
@operation.body = body
@response = operation.call
- Read upRead up
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"