Showing 24 of 75 total issues
File 0001_initial.py
has 500 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Generated by Django 2.0.6 on 2018-07-03 10:45
import _socket
from django.db import migrations, models
import django.db.models.deletion
Function processOutgoingTransactions
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processOutgoingTransactions( host, userName ) {
/*
Process each OutgoingTransaction one at a time.
Requests are chained:
1. GET outgoingtransaction from host;
Function processIncomingTransactions
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processIncomingTransactions( homeUrl, userName ) {
/*
Process each IncomingTransaction one at a time.
Requests are chained:
1. GET incoming from server;
Function processPendingFiles
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processPendingFiles() {
var url = client + '/django_collect_offline/';
var ajPendingFiles = $.ajax({
url: url,
type: 'GET',
Function exportBatch
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function exportBatch(server , userName) {
var url = client + '/django_collect_offline/';
var ajExportBatch = $.ajax({
url: url,
type: 'GET',
Function loadUsbTransactionFile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadUsbTransactionFile(server , userName) {
var url = client + '/django_collect_offline/dump-to-usb/';
var ajloadFile = $.ajax({
url: url,
type: 'GET',
Function register
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def register(self, models=None, wrapper_cls=None):
"""Registers with app_label.modelname, wrapper_cls.
"""
if get_offline_enabled():
self.loaded = True
- 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 autodiscover
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def autodiscover(self, module_name=None):
module_name = module_name or self.module_name
sys.stdout.write(" * checking for models to register ...\n")
for app in django_apps.app_configs:
try:
- 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 edcSyncReady
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function edcSyncReady(server, userName, apiToken) {
/* Prepare page elements */
var csrftoken = Cookies.get('csrftoken');
// configure AJAX header with csrf and authorization tokens
Function sendTransactionFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sendTransactionFile(file) {
/*
Send a file transaction to node server or central server.
*/
var url = client + '/django_collect_offline/';
Function edcSyncReady
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function edcSyncReady(hosts, userName, apiToken, homeUrl) {
/* Prepare page elements */
var hosts = JSON.parse( hosts );
var csrftoken = Cookies.get('csrftoken');
Function checkUSBConnectivity
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkUSBConnectivity(server , userName) {
var url = client + '/django_collect_offline/dump-to-usb/';
var checkUSBConnection = $.ajax({
url: url,
type: 'GET',
Function dumpTransactionMiddlemanFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dumpTransactionMiddlemanFile(server , userName) {
var url = client + '/django_collect_offline/dump-to-usb/';
var ajDumpFile = $.ajax({
url: url,
Function edcSyncUSBReady
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function edcSyncUSBReady(server, userName, apiToken) {
/* Prepare page elements */
var csrftoken = Cookies.get('csrftoken');
// configure AJAX header with csrf and authorization tokens
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self):
self.report_data = []
for client in Client.objects.all():
try:
self.history_model.objects.get(
- 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 serialize_on_save
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def serialize_on_save(sender, instance, raw, created, using, **kwargs):
Function create_auth_token
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_auth_token(sender, instance, raw, created, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, order_by=None, model=None, batch=None, producer=None, **kwargs):
Function serialize_m2m_on_save
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def serialize_m2m_on_save(sender, action, instance, using, **kwargs):
Function makePageElements
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function makePageElements ( divId, host, resourceName, listUrl, userName ) {