Showing 1,155 of 1,155 total issues
Method index
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
begin
if !current_user.has_role?('Librarian')
if @question
raise unless @question.shared?
Method get_manifestation_list_tsv_csv
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.get_manifestation_list_tsv_csv(manifestation_ids, selected_column = [])
csv_sep = SystemConfiguration.get("set_output_format_type") ? "\t" : ","
bom = "\xEF\xBB\xBF"
bom.force_encoding("UTF-8")
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
Method request_summary
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def request_summary
return nil unless @record
{
:subject_heading => @record['TR'].try(:[], 'TRD'),
- 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 search_by_gateway
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def search_by_gateway(options)
# db_type = db_names = nil
key_to_db = {
all: '_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
Method create
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def create
unless can_use_purchase_request?
access_denied; return
end
- 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 paginate_ncid_link
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def paginate_ncid_link(nacsis_cat)
return nil unless nacsis_cat.is_a?(NacsisCat)
links = []
if nacsis_cat.serial?
ids_ary = session['nacsis_cat_serial_ids']
- 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 destroy
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def destroy
unless can_use_purchase_request?
access_denied; return
else
if !user_signed_in?
- 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 build_new_record
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def build_new_record
if action_name == 'new'
form_input = params
else
form_input = params[:nacsis_user_request]
- 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 get_resource_import_results_tsv
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.get_resource_import_results_tsv(resource_import_results)
data = String.new
data << "\xEF\xBB\xBF".force_encoding("UTF-8") + "\n"
columns = [
[:title, 'activerecord.attributes.manifestation.original_title'],
- 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 user_list
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def user_list(params)
query = params[:query].to_s
@query = query.dup
@count = {}
- 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 setup_sunspot_rails
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def setup_sunspot_rails
solr_name = 'apache-solr-3.6.2'
solr_dir = "#{Rails.root}/vendor/#{solr_name}"
solr_url = "http://archive.apache.org/dist/lucene/solr/3.6.2/#{solr_name}.tgz"
solr_md5 = 'e9c51f51265b070062a9d8ed50b84647'
- 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 _connectKeypad
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_connectKeypad: function(target, inst) {
var field = $(target);
if (field.hasClass(this.markerClassName)) {
return;
}
Function flyout
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Menu.prototype.flyout = function(container, options) {
var menu = this;
this.resetFlyoutMenu = function(){
var allLists = container.find('ul ul');
Function _generateHTML
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_generateHTML: function(inst) {
var useTR = this._get(inst, 'useThemeRoller');
var isRTL = this._get(inst, 'isRTL');
var prompt = this._get(inst, 'prompt');
var separator = this._get(inst, 'separator');
Function tableMouseUp
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Calendar.tableMouseUp = function(ev) {
var cal = Calendar._C;
if (!cal) {
return false;
}
Method create_pdf_new
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_pdf_new(barcode_list, filename, code_words)
coord = Struct.new("Coord", :x, :y)
sheet = barcode_list.sheet
# cell size (a label)
cell = coord.new(to_pt(sheet.cell_w), to_pt(sheet.cell_h))
Method index
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
@count = {}
page = params[:page] || 1
# when create a item
Method update_or_create_series_statement
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_or_create_series_statement(datas, sheet, manifestation, series_statement)
if series_statement
mode = 'edit'
else
mode = 'create'
Method make_export_series_statements_list_tsv
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.make_export_series_statements_list_tsv(items, acquired_at)
data = String.new
data << "\xEF\xBB\xBF".force_encoding("UTF-8") + "\n"
# set term
Method create
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
@manifestation = Manifestation.new(params[:manifestation])
@original_manifestation = Manifestation.where(:id => params[:manifestation_id]).first
if @manifestation.respond_to?(:post_to_scribd)
@manifestation.post_to_scribd = true if params[:manifestation][:post_to_scribd] == "1"