Showing 25 of 27 total issues
Method start
has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring. Open
def start(port=8081)
serv = TCPServer.new("localhost", port)
MIDB::Interface::Server.info(:start, port)
# Manage the requests
- Read upRead up
- Create a ticketCreate a ticket
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 do_set
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def do_set()
MIDB::Interface::Errors.die(:syntax) if @args.length < 2
subset = @args[1].split(":")[0]
subcmd = @args[1].split(":")[1]
set = @args.length < 3 ? false : true
- Read upRead up
- Create a ticketCreate a ticket
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 start
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start(port=8081)
serv = TCPServer.new("localhost", port)
MIDB::Interface::Server.info(:start, port)
# Manage the requests
- Create a ticketCreate a ticket
File server_model.rb
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'midb/server_controller'
require 'midb/dbengine_model'
require 'midb/server_view'
require 'midb/hooks'
- Create a ticketCreate a ticket
Method post
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def post(data)
jss = self.get_structure() # For referencing purposes
input = self.query_to_hash(data)
bad_request = false
- Read upRead up
- Create a ticketCreate a ticket
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_matching_rows
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def get_matching_rows(column, pattern)
jso = Hash.new()
jss = self.get_structure()
db_column = nil
# Is the column recognized?
- Read upRead up
- Create a ticketCreate a ticket
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 do_set
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_set()
MIDB::Interface::Errors.die(:syntax) if @args.length < 2
subset = @args[1].split(":")[0]
subcmd = @args[1].split(":")[1]
set = @args.length < 3 ? false : true
- Create a ticketCreate a ticket
Method post
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post(data)
jss = self.get_structure() # For referencing purposes
input = self.query_to_hash(data)
bad_request = false
- Create a ticketCreate a ticket
Method put
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def put(id, data)
jss = self.get_structure() # For referencing purposes
input = self.query_to_hash(data)
bad_request = false
- Create a ticketCreate a ticket
Method get_entries
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_entries(id)
jso = Hash.new()
dbe = MIDB::API::Dbengine.new(@engine.config, @db)
dblink = dbe.connect()
- Read upRead up
- Create a ticketCreate a ticket
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_matching_rows
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_matching_rows(column, pattern)
jso = Hash.new()
jss = self.get_structure()
db_column = nil
# Is the column recognized?
- Create a ticketCreate a ticket
Method put
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def put(id, data)
jss = self.get_structure() # For referencing purposes
input = self.query_to_hash(data)
bad_request = false
- Read upRead up
- Create a ticketCreate a ticket
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 delete
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete(id)
# Check if the ID exists
db = MIDB::API::Dbengine.new(@engine.config, @db)
dbc = db.connect()
dbq = db.query(dbc, "SELECT * FROM #{self.get_structure.values[0].split('/')[0]} WHERE id=#{id};")
- Create a ticketCreate a ticket
Method get_column_entries
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_column_entries(column)
jso = Hash.new()
jss = self.get_structure()
db_column = nil
# Is the column recognized?
- Create a ticketCreate a ticket
Method get_all_entries
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_all_entries()
jso = Hash.new()
# Connect to database
dbe = MIDB::API::Dbengine.new(@engine.config, @db)
- Read upRead up
- Create a ticketCreate a ticket
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 delete
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def delete(id)
# Check if the ID exists
db = MIDB::API::Dbengine.new(@engine.config, @db)
dbc = db.connect()
dbq = db.query(dbc, "SELECT * FROM #{self.get_structure.values[0].split('/')[0]} WHERE id=#{id};")
- Read upRead up
- Create a ticketCreate a ticket
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_entries
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_entries(id)
jso = Hash.new()
dbe = MIDB::API::Dbengine.new(@engine.config, @db)
dblink = dbe.connect()
- Create a ticketCreate a ticket
Method get_column_entries
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_column_entries(column)
jso = Hash.new()
jss = self.get_structure()
db_column = nil
# Is the column recognized?
- Read upRead up
- Create a ticketCreate a ticket
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 help
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.help(what)
case what
when :list
puts "midb v1.1.1 has several commands that you can use. For detailed information, see `midb help command`."
puts " "
- Create a ticketCreate a ticket
Method get_all_entries
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_all_entries()
jso = Hash.new()
# Connect to database
dbe = MIDB::API::Dbengine.new(@engine.config, @db)
- Create a ticketCreate a ticket