Showing 39 of 39 total issues
Class SteamId
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class SteamId
include Cacheable
cacheable_with_ids :custom_url, :steam_id64
Method fetch
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def fetch
profile = parse "#{base_url}?xml=1"
raise SteamCondenser::Error, profile['error'] unless profile['error'].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 reply
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def reply
receive_packet 1400
is_compressed = false
packet_checksum = 0
- 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 get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.get(format, interface, method, version = 1, params = {})
params = { key: WebApi.api_key }.merge params unless WebApi.api_key.nil?
params = { format: format }.merge params
protocol = @@secure ? 'https' : 'http'
url = "#{protocol}://api.steampowered.com/#{interface}/#{method}/v#{version}/" +
- 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 handle_response_for_request
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def handle_response_for_request(request_type, repeat_on_failure = true)
case request_type
when :challenge then
request_packet = Packets::A2S_PLAYER_Packet.new
expected_response = Packets::S2C_CHALLENGE_Packet
- 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 servers
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def servers(region_code = MasterServer::REGION_ALL, filters = '', force = false)
finished = false
current_server = '0.0.0.0:0'
server_array = []
- 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 reply
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reply
receive_packet 1400
is_compressed = false
packet_checksum = 0
Method handle_response_for_request
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_response_for_request(request_type, repeat_on_failure = true)
case request_type
when :challenge then
request_packet = Packets::A2S_PLAYER_Packet.new
expected_response = Packets::S2C_CHALLENGE_Packet
Method initialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(data)
super S2A_INFO2_HEADER, data
info.merge!({
protocol_version: @content_data.getbyte,
Method fetch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch
data = WebApi.json! "IEconItems_#{app_id}", 'GetSchema', 1, language: language
@attributes = {}
data[:attributes].each do |attribute|
Method initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(data)
super S2A_INFO_DETAILED_HEADER, data
info.merge!({
game_ip: @content_data.cstring,
Method packet_from_data
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.packet_from_data(raw_data)
header = raw_data[0].ord
data = raw_data[1..-1]
case header
Method initialize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def initialize(data)
super S2A_INFO2_HEADER, data
info.merge!({
protocol_version: @content_data.getbyte,
- 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 new
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def new(*args)
arity = self.instance_method(:initialize).arity.abs
args += Array.new(arity - args.size) if args.size < arity
bypass_cache = args.size > arity + 1 ? args.pop : false
fetch = args.size > arity ? args.pop : true
- 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 servers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def servers(region_code = MasterServer::REGION_ALL, filters = '', force = false)
finished = false
current_server = '0.0.0.0:0'
server_array = []
Method initialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(inventory, item_data)
@inventory = inventory
@defindex = item_data[:defindex]
@backpack_position = item_data[:inventory] & 0xffff
Method reply
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reply
receive_packet 1400
if @buffer.long == 0xFFFFFFFE
split_packets = []
Method fetch
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch
profile = parse "#{base_url}?xml=1"
raise SteamCondenser::Error, profile['error'] unless profile['error'].nil?
Method reply
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def reply
receive_packet 1400
if @buffer.long == 0xFFFFFFFE
split_packets = []
- 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 add_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_info(player_data)
unless player_data[:name] == @name
raise Error, 'Information to add belongs to a different player.'
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"