Showing 551 of 2,707 total issues
Function when
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
when: function( subordinate /* , ..., subordinateN */ ) {
var i = 0,
resolveValues = slice.call( arguments ),
length = resolveValues.length,
Function bonus
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def bonus(request, player_id):
player = get_object_or_404(Player, pk=player_id)
if request.method == 'POST':
form = BonusForm(request.POST)
- 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 extra_stats
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def extra_stats(request):
"""
Generate extra statistics, dump them as JSON
* Numărul de jucători care au accesat în 95% din zile site-ul
- 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 review
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def review(request, workshop):
player = request.user.get_profile()
workshop = get_object_or_404(Workshop, pk=workshop)
assessment = workshop.get_assessment(player)
- 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 launch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def launch(request, to_id):
lock = challengeLock.lock()
logging.info("Locked.")
flush_transaction()
- 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 setup_scoring
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def setup_scoring():
""" Prepare database for Scoring """
for cc in CORE_POINTS:
if not Coin.get(cc):
- 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 clone
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, node, clone, i, srcElements,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
Function access
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
Function dispatch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
Function showHide
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showHide( elements, show ) {
var display, elem, hidden,
values = [],
index = 0,
length = elements.length;
Function clone
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, node, clone, i, srcElements,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
Function add
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function(element, interval, label, fn, times, belay) {
var counter = 0;
if (jQuery.isFunction(label)) {
if (!times)
Function showHide
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showHide( elements, show ) {
var display, elem, hidden,
values = [],
index = 0,
length = elements.length;
Function access
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
Function dispatch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
Function cleanData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
Function fieldValue
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fieldValue = function(el, successful) {
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
if (successful === undefined) {
successful = true;
}
Function backdrop
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
Function style
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
Function show
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)