Showing 223 of 433 total issues
Function jsWrapper
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsWrapper: function(tableid, colNums) {
if(!(tableid in fdTableSort.tmpCache)) { return false; };
if(!(tableid in fdTableSort.tableCache)) { fdTableSort.prepareTableData(document.getElementById(tableid)); };
if(!(colNums instanceof Array)) { colNums = [colNums]; };
Function hide
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Popup.prototype.hide = function() {
// If this was a temp object creating on-the-fly, then remove objects from the DOM so
// The document doesn't get littered with extra objects
if (this.destroyDivOnHide) {
DOM.removeNode(this.div);
- 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 link_to_if_authorized
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def link_to_if_authorized(name, options = {}, html_options = {}, *rest)
#TODO Test then Refactor!!! This is a spike.
# hsh = ::ActionController::Routing::Routes.recognize_path url.gsub(/\?.*$/,''), :method=> :get
if options.is_a?String
url = options
- 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 replaceAll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function replaceAll() {
var ti = this.currentTextIndex;
var wi = this.currentWordIndex;
if( !this.wordWin ) {
alert( 'Error: Word frame not available.' );
Function replaceAll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function replaceAll() {
var ti = this.currentTextIndex;
var wi = this.currentWordIndex;
if( !this.wordWin ) {
alert( 'Error: Word frame not available.' );
Function getEnabledDates
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
o.getEnabledDates = function(y, m) {
var obj = {};
var d = datePicker.getDaysPerMonth(m - 1, y);
m = m < 10 ? "0" + String(m) : m;
var day,tmp,de,me,ye,disabled;
Function addScreen
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Popup.prototype.addScreen = function() {
if (this.screen==null) {
this.screen = this.createDiv();
this.screen.style.top="0px";
this.screen.style.left="0px";
Function _spellcheck
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _spellcheck() {
var ww = this.wordWin;
// check if this is the last word in the current text element
if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) {
Function _spellcheck
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _spellcheck() {
var ww = this.wordWin;
// check if this is the last word in the current text element
if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) {
Method flags
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.flags
pids = `ps wx |grep -v grep |grep 'runner' |grep 'PrimeCache'| grep -v 'nice' |cut -f 1 -d' '`
if pids.split("\n").size > 1
puts "Script already running"
exit 0
Consider simplifying this complex logical expression. Open
if(inp.className && (inp.className.search(regExp6) != -1 || inp.className.search(/split-date/) != -1) && ((inp.tagName.toLowerCase() == "input" && (inp.type == "text" || inp.type == "hidden")) || inp.tagName.toLowerCase() == "select")) {
if(inp.id && document.getElementById('fd-'+inp.id)) { continue; };
if(!inp.id) { inp.id = "fdDatePicker-" + uniqueId++; };
Function _spellcheck
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function _spellcheck() {
var ww = this.wordWin;
// check if this is the last word in the current text element
if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) {
- 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_defaults_from_definition
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_defaults_from_definition
return unless new_record?
if intervention_definition.blank? || intervention_definition.new_record?
self.frequency ||= Frequency.find_by_title('Weekly')
- 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 whom
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def whom
if @whom
@whom
else
w = []
- 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 _spellcheck
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function _spellcheck() {
var ww = this.wordWin;
// check if this is the last word in the current text element
if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) {
- 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 score_element
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def score_element(element)
if element.kind=="scale" and !element_definitions_for_answers.include?(element) then
@score_results[element.question_definition][element] = "A value must be picked"
elsif element.kind=="sa" and !element_definitions_for_answers.include?(element) then
@score_results[element.question_definition][element]= "Text must be entered"
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create
params[:team_consultation] ||= {}
params[:team_consultation].merge!(:student_id => current_student_id, :requestor_id => current_user.id)
params[:team_consultation][:draft] = true if params[:commit] == "Save as Draft" #the js in the view stopped working?
@team_consultation = TeamConsultation.new(params[:team_consultation])
- 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 index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def index
#TODO test and refactor
flash[:notice]=nil
@without=params[:without]
- 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 populate_from_csv_file
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def populate_from_csv_file(parent,model_name,parent_id_sym, parenthash ={})
Hash.new.tap do |reshash|
CSV.table("#{path}/#{model_name.pluralize}.csv").each do |ck|
next unless ckhash = prephash(ck)
ckhash[parent_id_sym]= parenthash[ck[parent_id_sym]] unless parenthash.empty?
- 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 enforce_session_selections
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def enforce_session_selections
return true unless params[:id]
# raise "I'm here" if selected_students_ids.nil?
if selected_student_ids and selected_student_ids.include?(params[:id])
self.current_student_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"