Showing 15 of 108 total issues
File urls_redirect.py
has 3416 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.conf.urls import url
from django.http import HttpResponseNotFound, HttpResponseServerError
from django.views import View
from django.views.generic import RedirectView
from directory_constants import urls
Function invest
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
dit.tagging.invest = new function() {
this.init = function(page) {
$(document).ready(function() {
File dit.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Main dit.js file
// Expected to hold global variables, messages, and provide base to namespaces
var dit = {
// Namespace to be populated by external files
Function responsive
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
dit.responsive = (new function () {
// Constants
var RESET_EVENT = "dit:responsive:reset";
var RESPONSIVE_ELEMENT_ID = "dit-responsive-size";
Function Expander
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Expander($target, options) {
var EXPANDER = this;
var id = utils.generateUniqueStr(TYPE + "_");
var $wrapper, $control;
Function home
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
dit.home = (new function () {
// Page init
this.init = function() {
dit.responsive.init({
"desktop": "min-width: 768px",
Function languageSelector
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
dit.components.languageSelector = (new function() {
var LANG_SELECT_CLOSE_BUTTON_ID = "header-language-selector-close";
/* Extends SelectTracker to meet additional display requirement
Function init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.init = function(page) {
$(document).ready(function() {
addTaggingForFeedbackLink();
Function move
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Expander.move = function(e) {
var counter = this.links.counter;
var $links = this.links.$found;
if($links) {
switch(e.which) {
Function languageSelector
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
dit.components.languageSelector = (new function() {
var LANG_SELECT_CLOSE_BUTTON_ID = "header-language-selector-close";
/* Extends SelectTracker to meet additional display requirement
- 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 Modal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Modal($container, options) {
var modal = this;
var config = $.extend({
$activators: $(), // (optional) Element(s) to control the Modal
closeOnBuild: true, // Whether intial Modal view is open or closed
Function responsive
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
dit.responsive = (new function () {
// Constants
var RESET_EVENT = "dit:responsive:reset";
var RESPONSIVE_ELEMENT_ID = "dit-responsive-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 localised_urls
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def localised_urls(self):
localised = []
requested_language = translation.get_language()
url_parts = urlparse(self.request.build_absolute_uri())
base_url = f'{url_parts.scheme}://{url_parts.netloc}/'
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function process_request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_request(self, request):
if not request.session.get('utm'):
request.session['utm'] = {}
if request.GET.get('utm_source'):
- 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"