Showing 35 of 60 total issues
Function _reposition
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tour.prototype._reposition = function(tip, step) {
var offsetBottom, offsetRight, original_left, original_offsetHeight, original_offsetWidth, original_top, tipOffset;
original_offsetWidth = tip[0].offsetWidth;
original_offsetHeight = tip[0].offsetHeight;
tipOffset = tip.offset();
Function refresh
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Backlog.prototype.refresh = function(updateHistory, data) {
var _this = this;
var sorting = Sorting.instances[0];
var filter = Filter.instances[0];
Function html
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
html: function (ctl) {
var re_nl = null;
var st = ctl.val();
Function attachEvents
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Labels.prototype.attachEvents = function() {
var _this = this;
var options = {
success: function(responseText, status, xhr) {
Function initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function() {
$(".backlog-sortable").sortable({
connectWith: ".backlog-connected",
placeholder: "backlog-placeholder-element",
update: function(event, ui) {
Function toUpdateForm
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
GridDialog.prototype.toUpdateForm = function(event) {
if ($(event.target).is(".destroy")) return;
var _this = this;
Avoid deeply nested control flow statements. Open
for (j=0; j < files.length; j++) {
a.push({name: n, value: files[j], type: el.type});
}
Avoid deeply nested control flow statements. Open
if (elements)
elements.push(el);
Method apply_filter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_filter(reflection)
return reflection unless params[:filter]
persist_filter_information!
- 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 process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process(text, project)
text.gsub! PROJECT_WIDE_MATCHER do |match|
key = $1
number = $2
- 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 this;
Avoid too many return
statements within this function. Open
return $(el).val();
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return this;
Method issue_priority
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def issue_priority(issue, short = false)
return unless issue.issue_priority
name = if short
issue.issue_priority.name[0].upcase
- 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"