Showing 207 of 457 total issues
File quail.jquery.js
has 7894 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! QUAIL quailjs.org | quailjs.org/license */
;(function($) {
'use strict';
// Polyfill Function.prototype.bind
// @see https://gist.github.com/dsingleton/1312328
Function save_csv
has a Cognitive Complexity of 173 (exceeds 5 allowed). Consider refactoring. Open
def save_csv():
""" Last step in CSV workflow to update the resource and descriptor data models. """
csv_storage = CsvStorage.most_recent(user=current_user)
if csv_storage is None:
db.session.rollback()
- 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 color
has 365 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.components.color = (function () {
function buildCase(test, Case, element, status, id, message) {
test.add(Case({
element: element,
File views.py
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime
import json
import geocoder
import time
import os
Function Test
has 288 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.lib.Test = (function () {
/**
* A collection of Cases.
*/
File map.js
has 560 lines of code (exceeds 250 allowed). Consider refactoring. Open
// This JS file is for the map and list view creations on the homepage of the
// Maps4All site for the user. This example requires the Places library. Include
// the libraries=places parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
Function set_required_option_descriptor
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def set_required_option_descriptor():
""" Choose one option descriptor to be the required option descriptor.
Can only select from option descriptors in the CSV or the existing required
option descriptor if any. """
csv_storage = CsvStorage.most_recent(user=current_user)
- 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 htmlTagValidator
has 222 lines of code (exceeds 25 allowed). Consider refactoring. Open
var htmlTagValidator=function(){
var startingTagFirstChar="<",
startingTagLastChar=">",
closingTagSecondChar="/",
selfClosingTagSecondToLastChar="/",
Function TestCollection
has 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.lib.TestCollection = (function () {
/**
* A Collection of Tests.
*/
Function Case
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.lib.Case = (function () {
/**
* A Case is a test against an element.
*/
Function TestAggregator
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.lib.wcag2.TestAggregator = (function () {
var pointerMap = {
elms: [],
pointers: [],
Function search_resources
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def search_resources():
name = request.args.get('name')
if name is None:
name = ""
req_options = request.args.getlist('reqoption')
- 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 SuccessCriteria
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.lib.SuccessCriteria = (function () {
/**
* A Collection of Tests.
*/
Function validate_required_option_descriptor
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def validate_required_option_descriptor():
""" If there are resources that don't have the selected required option descriptor value set,
enforce that they are updated to have the required option descriptor """
csv_storage = CsvStorage.most_recent(user=current_user)
if csv_storage is None:
- 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_row
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def upload_row():
""" Processes each Deferred Ajax request """
data = json.loads(request.form['json'])
# Store CSV fields as descriptors
- 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
File views.py
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
from flask import abort, flash, render_template, redirect, url_for, request
from flask.ext.login import login_required
from sqlalchemy.exc import IntegrityError
from wtforms.fields import SelectField
from flask_wtf.file import InputRequired
Function linkHasAUniqueContext
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.linkHasAUniqueContext = function (quail, test, Case) {
var blockStyle = [
'block',
'flex',
File views.py
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import datetime
from flask import (
abort,
flash,
Function edit
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def edit(resource_id):
"""Edit a resource."""
resource = Resource.query.get(resource_id)
if resource is None:
abort(404)
- 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 set_descriptor_types
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def set_descriptor_types():
""" Sets each descriptor in the CSV to be an option, text, or hyperlink descriptor """
csv_storage = CsvStorage.most_recent(user=current_user)
if csv_storage is None:
db.session.rollback()
- 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"