Showing 419 of 572 total issues
Method show
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def show
if @cud.instructor? || @attachment.released?
begin
attached_file = @attachment.attachment_file
if attached_file.attached?
- 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
Method update_config
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_config
required_params = %w[iss developer_key auth_url oauth2_access_token_url]
required_params.each do |param|
if params[param].blank?
flash[:error] = "#{param} field was missing"
- 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 defaultFormatter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
defaultFormatter: function(row, cell, value, columnDef, data) {
user = data.email;
asmt = columnDef.name;
submission_status_key = columnDef.field + "_submission_status"
- 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
Method set_submission
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_submission
begin
@submission = @assessment.submissions.find(params[:submission_id] || params[:id])
rescue StandardError
flash[:error] = "Could not find submission with id #{params[:submission_id] || params[:id]}."
- 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
Method upload
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def upload
uploaded_makefile = params[:autograder][:makefile]
uploaded_tar = params[:autograder][:tar]
unless uploaded_makefile.nil?
File.open(Rails.root.join("courses", @course.name, @assessment.name, "autograde-Makefile"),
- 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
Method regradeAll
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def regradeAll
# Grab all of the submissions for this assessment
@submissions = @assessment.submissions.where(special_type: Submission::NORMAL)
.order("version DESC")
- 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
Method regradeBatch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def regradeBatch
submission_ids = params[:submission_ids]
# Now regrade only the most recent submissions. Keep track of
# any handins that fail.
- 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 CanvasGraphics_paintImageMaskXObject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) {
var ctx = this.ctx;
var width = img.width, height = img.height;
var fillColor = this.current.fillColor;
var isPatternFill = this.current.patternFill;
Function SVGGraphics_setFont
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
setFont: function SVGGraphics_setFont(details) {
var current = this.current;
var fontObj = this.commonObjs.get(details[0]);
var size = details[1];
this.current.font = fontObj;
Function asyncPostProcessRows
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function asyncPostProcessRows() {
while (postProcessFromRow <= postProcessToRow) {
var row = (vScrollDir >= 0) ? postProcessFromRow++ : postProcessToRow--;
var cacheEntry = rowsCache[row];
if (!cacheEntry || row >= getDataLength()) {
Function get_brush_interval
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_brush_interval(args) {
var resolution = args.brushing_interval,
interval;
if (!resolution) {
Method stats_table
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stats_table(data)
out =
'<table class="striped">
<thead>
<tr class="red darken-3 white-text">
Method send_test_email
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_test_email
required_params = %w[protocol host address port authentication communication_protocol to_email
from_email default_from]
# Create temp file to save the new configuration
Function search_enter_action
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function search_enter_action(query, tab_name, instances, archived_instances, empty_message, selected_user_ids) {
var search_input = query.toLowerCase().trim();
if (search_input === "") {
set_tab_html(
true,
Function scrollPage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scrollPage(dir) {
var deltaRows = dir * numVisibleRows;
scrollTo((getRowFromPosition(scrollTop) + deltaRows) * options.rowHeight);
render();
Function cleanUpCells
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cleanUpCells(range, row) {
var totalCellsRemoved = 0;
var cacheEntry = rowsCache[row];
// Remove cells outside the range.
Function Range
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Range(fromRow, fromCell, toRow, toCell) {
if (toRow === undefined && toCell === undefined) {
toRow = fromRow;
toCell = fromCell;
}
Function compileFilterWithCaching
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compileFilterWithCaching() {
var filterInfo = getFunctionInfo(filter);
var filterBody = filterInfo.body
.replace(/return false[;}]/gi, "{ continue _coreloop; }")
Function putBinaryImageMask
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function putBinaryImageMask(ctx, imgData) {
var height = imgData.height, width = imgData.width;
var partialChunkHeight = height % FULL_CHUNK_HEIGHT;
var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;
var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;
Function Metadata_parse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function Metadata_parse() {
var doc = this.metaDocument;
var rdf = doc.documentElement;
if (rdf.nodeName.toLowerCase() !== 'rdf:rdf') { // Wrapped in <xmpmeta>