Showing 43 of 89 total issues
Function show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
Function mkdir
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.mkdir = function (cb, path) {
var success = function (data, status) {
if (cb !== undefined) {
cb(null);
Function submitJob
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.submitJob = function (cb, job) {
var success = function (data, status) {
addMonitoredJob(data.job_id, data.status, job.onUpdate);
if (cb != undefined) {
cb(null, data);
Function applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
Function show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
Function run
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.run = function (cb, job) {
var success = function (data, status) {
if (cb != undefined) {
cb(null, data);
}
Function abortJob
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.abortJob = function (cb, jobId) {
var success = function (data, status) {
if (cb !== undefined) {
cb(null);
}
Function checkPosition
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var height = this.$element.height()
var offset = this.options.offset
Function processFetchResult
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.processFetchResult = function(data, successCallback) {
if(this.fieldNames.length > 0) {
if(Array.isArray(data)) {
var result = [];
var object = {};
Function hide
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
Function refresh
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
ScrollSpy.prototype.refresh = function () {
var that = this
var offsetMethod = 'offset'
var offsetBase = 0
Function deleteJob
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.deleteJob = function (cb, jobId) {
var success = function (data, status) {
if (cb !== undefined) {
cb(null, data);
}
Function next
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
Method execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def execute
app.assign_attributes(@params)
build_activity(:updated) if app.update?
content_changed = app.content_changed?
- 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 store!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def store!(file)
tmp_dir = Dir.mktmpdir('plgapp')
Zip::File.open(file.file) do |zipfile|
zipfile.each do |f|
unless f.symlink?
- 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
Avoid deeply nested control flow statements. Open
if (job.status == 'FINISHED' ||
job.status == 'ERROR') {
removeMonitoredJob(mJobId);
}
Method calculate_changes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def calculate_changes
{ create_or_update: [], delete: [] }.tap do |changes|
delta['entries'].each do |entry|
path, entry_hsh = entry
existing_entry = entry(remote_to_relative(path))
- 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 calculate_changes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def calculate_changes
{ create: [], update: [] }.tap do |changes|
changes[:create] << local_props('.') unless registered?
list_local.each do |p|
- 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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options)
if range = (options.delete(:in) || options.delete(:within))
raise ArgumentError, ':in and :within must be a Range' unless range.is_a?(Range)
options[:minimum], options[:maximum] = range.begin, range.end
options[:maximum] -= 1 if range.exclude_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
Avoid too many return
statements within this function. Open
return false