Showing 44 of 99 total issues
Function upload
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def upload(
filename, wikifilename, sourceurl, http_host, filedesc, username,
statuscallback=None, errorcallback=None
):
"""Upload a file from filename to wikifilename."""
- 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 main
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def main(
Function ffmpeg_add_audio_options
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ffmpeg_add_audio_options(self, options, p):
"""
Add ffmpeg shell options for audio.
@param options 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
Function checkStatusSocket
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
checkStatusSocket: function () {
if ( window.socket ) {
return;
}
Function addTask
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
addTask: function ( taskdata ) {
if ( !$addTaskDialog ) {
$addTaskDialog = $( '<div>' )
.html( nunjucksEnv.render( 'addTask.html' ) );
Function get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get(lang):
"""Get the i18n of language lang and output dict."""
i18nkey = 'i18n:' + lang
gval = g.get(i18nkey, None)
if gval:
- 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 upload
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload(
Function upload_pwb
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_pwb(
Function download
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def download(
Function encode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def encode(source, origkey, statuscallback=None, errorcallback=None):
"""Main encode function."""
source = os.path.abspath(source)
preserve = {'video': False, 'audio': 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
Function upload_ss
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_ss(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if duration_match:
duration = time_to_seconds(duration_match.group(1))
else:
Avoid deeply nested control flow statements. Open
if position_match:
position = time_to_seconds(position_match.group(1))
if duration and position:
newpercentage = min(int(
math.floor(100 * position / duration)
Function list_formats
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def list_formats():
"""List the possible convert formats from a given audio/video pair."""
formats = []
prefer = ''
video = _boolize(request.form['video'])
- 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 subtitles
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def subtitles(
Function open_session
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def open_session(self, app, request):
"""Get session from Redis / start a new session."""
sid = request.cookies.get(app.session_cookie_name)
if sid:
val = self.redis.get(self.prefix + sid)
- 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 save_session
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save_session(self, app, session, response):
"""Save session to Redis."""
domain = self.get_cookie_domain(app)
path = url_for('main', _external=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
Function handle_chunked
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def handle_chunked(f, permpath, content_range):
try:
content_range = RE_CONTENT_RANGE.match(content_range)
assert content_range, 'Invalid content range!'
- 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 getlanguage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getlanguage():
"""Get the user language."""
gval = g.get('language', None)
if gval:
return gval
- 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"