DavidAwad/SpaceShare

View on GitHub

Showing 7 of 15 total issues

Function 1 has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/** @jsx React.DOM */

/*
var DynamicSearch = React.createClass({
Severity: Major
Found in app/static/js/app.js - About 2 hrs to fix

    Function e has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    Severity: Minor
    Found in app/static/js/app.js - About 2 hrs to fix

    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 space_taken has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def space_taken(spacenum):
        '''
        searches for a given integer in the database
        and returns True if the space is taken.
    
    
    Severity: Minor
    Found in app/models.py - About 55 mins to fix

    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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def upload():
        logger.info('TOLOSEFA')
        # get the form inputs
        space = int(request.form['space'])
        data_uri = request.form['data_uri']
    Severity: Minor
    Found in app/controllers.py - About 45 mins to fix

    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 yolo_again has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def yolo_again(task_id):
            print('task status request received ' + str(task_id))
            task = print_words.AsyncResult(task_id)
            print ("task state : " + task.state)
            if task.state == 'PENDING':
    Severity: Minor
    Found in app/server.py - About 35 mins to fix

    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

    Avoid too many return statements within this function.
    Open

            return False
    Severity: Major
    Found in app/models.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return False
      Severity: Major
      Found in app/models.py - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language