Showing 17 of 51 total issues
File flot-demo.js
has 1190 lines of code (exceeds 250 allowed). Consider refactoring. Open
//Flot Line Chart
$(document).ready(function() {
console.log("document ready");
var offset = 0;
plot();
Function from_fcgi_response
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def from_fcgi_response(text,flags = 0):
result = ''
state = 0
if flags & TEST_GET_VALUES:
pairs = make_pairs([('FCGI_MPXS_CONNS','0'),('FCGI_MAX_CONNS','5'),('FCGI_MAX_REQS','5')])
- 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
Function test_io
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def test_io(name,method,input_f,output_f,seed=12,load=load_file,parse=identity):
result=''
try:
input=load(input_f)
output=load_file(output_f)
- 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
Function general_tests
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def general_tests(method):
print "------------------- General Tests --------------------"
session = Session()
session.transmit('/new')
cookie = session.received['sc']
Function update_state
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def update_state(self):
if self.print_cookies:
print "Got following cookies"
for name,cookie in self.received.items():
if self.print_cookies:
- 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
Function plot
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function plot() {
var sin = [],
cos = [];
for (var i = 0; i < 12; i += 0.2) {
sin.push([i, Math.sin(i + offset)]);
Function doPlot
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doPlot(position) {
$.plot($("#flot-line-chart-multi"), [{
data: oilprices,
label: "Oil price ($)"
}, {
Function transfer_all
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def transfer_all(s,inp):
s.setblocking(1)
s.sendall(inp)
s.setblocking(0)
result = ''
- 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
Function test_io
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def test_io(name,method,input_f,output_f,seed=12,load=load_file,parse=identity):
Function to_fcgi_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to_fcgi_request(text,flags = 0):
request = '';
if flags & TEST_GET_VALUES:
request+=fcgi_record(GET_VALUES,make_pairs([('FCGI_MPXS_CONNS',''),('FCGI_MAX_CONNS',''),('FCGI_MAX_REQS','')]),0)
if flags & TEST_KEEP_ALIVE:
- 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
Function test_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def test_request(url,status,content='ignore',valid=[],notvalid=[]):
Function test_valid
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def test_valid(name,url,params,ans,status):
Function test_unfinished_read
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def test_unfinished_read(msg,reads,ignore):
print "Tesing %s with %d reads" % (msg,reads)
s=make_sock();
read_size = s.getsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF)
print "SO_RCVBUF=%d" % read_size
- 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
Function test_request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def test_request(url,status,content='ignore',valid=[],notvalid=[]):
print "-- Testing %s" % url
s=make_sock();
s.send('GET %s HTTP/1.0\r\n\r\n' % url);
text = ''
- 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 requested_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def requested_file(request_line)
request_uri = request_line.split(" ")[1]
path = URI.unescape(URI(request_uri).path)
clean = []
- 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
Function general_tests
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def general_tests(method):
print "------------------- General Tests --------------------"
session = Session()
session.transmit('/new')
cookie = session.received['sc']
- 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
Function test_io
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_io(input,socket_type,target):
try:
s=socket.socket(socket_type,socket.SOCK_STREAM);
try:
s.connect(target)
- 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"