Showing 207 of 457 total issues
Function write
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tautologistics.NodeHtmlParser.HtmlBuilder.prototype.write = function(element) {
// this._raw.push(element);
if (this._done) {
this.handleCallback(new Error("Writing to the builder after done() called is not allowed without a reset()"));
}
Function submitCsvData
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function submitCsvData(numRows, rowObjects, fields) {
// Create list of Ajax requests: first processing the fields of the CSV then
// the rows
var ajaxReqs = [];
var resetOrUpdate = document.getElementById('reset').checked
Function set_desc_values
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def set_desc_values(self):
all_descs = self.csv_descriptors
opt_descs = dict([(d.name, d) for d in all_descs if d.descriptor_type == 'option'])
for row in self.csv_rows:
for key in row.data:
- 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 languageChangesAreIdentified
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.languageChangesAreIdentified = function(quail, test, Case) {
var $scope = test.get('$scope');
var currentLanguage = quail.components.language.getDocumentLanguage($scope, true);
var text, regularExpression, matches, $element, element, failed;
Function WCAGGuideline
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.lib.WCAGGuideline = (function () {
/**
* A Collection of Tests.
*/
Function parseCSV
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function parseCSV() {
var numRows = 0;
var numFields = 0;
var errorList = [];
var rowObjects = [];
- 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 displayDetailedResourceView
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayDetailedResourceView(marker) {
// get descriptor information as associations
$.get('get-associations/' + marker.resourceID).done(function(associations) {
$("#map").hide();
Function review_required_option_descriptor
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def review_required_option_descriptor():
req_opt_desc_const = RequiredOptionDescriptorConstructor.query.all()[0]
form = RequiredOptionDescriptorMissingForm()
missing_resources = []
resources = Resource.query.all()
- 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 run
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
run : function (options) {
if (options.reset) {
quail.accessibilityResults = { };
}
File resource.py
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
from .. import db
from .. models import Rating
import os
Function defineUniqueSelector
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
defineUniqueSelector: function (element) {
/**
* Indicates whether the selector string represents a unique DOM element.
*
* @param {string} selector
Function parseCSV
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseCSV() {
var numRows = 0;
var numFields = 0;
var errorList = [];
var rowObjects = [];
Function Technique
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.lib.Technique = (function () {
/**
* A collection of Cases.
*/
Function traverseVisualTreeForBackground
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
traverseVisualTreeForBackground: function(element, property) {
if (!element.attr('data-cacheId')) {
element.attr('data-cacheId', 'id_' + Math.random());
}
File views.py
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
from flask import abort, flash, redirect, render_template, url_for, request, make_response
from flask.ext.login import login_required
from sqlalchemy.exc import IntegrityError
from wtforms.fields import SelectMultipleField, SelectField, TextAreaField, StringField
from flask_wtf.file import InputRequired
Function search_resources
has a Cognitive Complexity of 19 (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 download
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def download():
# format string or list of strings to be csv-friendly
def csv_friendly(str):
return '\"{}\"'.format(str.replace('\"', '\"\"')) if str else ''
- 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 animatedGifMayBePresent
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.animatedGifMayBePresent=function(quail, test, Case){
/**
* Test if gif is animated
* Implemented from: https://gist.github.com/3012623.git
Function aInPHasADistinctStyle
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.aInPHasADistinctStyle=function(quail, test, Case){
/**
* Checks if an element has a border set
* @param element
Function placeholder
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
quail.components.placeholder = function(quail, test, Case, options) {
var resolve = function (element, resolution) {
test.add(Case({
element: element,