File jquery.treeTable.js
has 564 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0.
/* global callbackCheckboxes */
/* global callbackCreateElement */
/* global callbackCustomElements */
- Create a ticketCreate a ticket
Function ttRenderChildren
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ttRenderChildren = function () {
var node = $(this);
var table = node.ttTable();
var options = table.ttOptions();
var elements = $.data(node[0], 'children');
- Create a ticketCreate a ticket
Function ttReloadTree
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ttReloadTree = function () {
var table = $(this);
var options = table.ttOptions();
table.find('tbody tr').remove();
table.after('<img class="reloadTableIndicator" alt="" src="' + json.global.coreWebroot + '/public/images/icons/loading.gif" />');
- Create a ticketCreate a ticket
Function treeTable
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.treeTable = function (opts) {
var table = $(this);
var options = $.extend({}, $.fn.treeTable.defaults, opts);
// default to global callbacks in none were passed
- Create a ticketCreate a ticket
Function ttInitTable
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ttInitTable = function () {
var table = $(this);
var options = table.ttOptions();
// Make visible that a row is clicked
table.find('tbody tr').unbind('mousedown');
- Create a ticketCreate a ticket
Function ttFetchChildren
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ttFetchChildren = function () {
var node = $(this);
if (node === undefined) {
return;
}
- Create a ticketCreate a ticket
Function ttInitNode
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ttInitNode = function () {
var node = $(this);
if (node === undefined) {
return;
}
- Create a ticketCreate a ticket
Function ttColorLines
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ttColorLines = function () {
var table = $(this);
var grey = false;
table.find('tr').each(function (index) {
if (index === 0) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (e.target.className != 'expander') {
node.toggleBranch();
}
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!$(this).is(':hidden')) {
if (grey) {
$(this).css('background-color', '#f9f9f9');
$(this).hover(function () {
$(this).css('background-color', '#F3F1EC');
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 176.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!options.expandable || $(this)[0].className.search(options.childPrefix) == -1) {
if (isNaN(defaultPaddingLeft)) {
defaultPaddingLeft = parseInt($($(this).children("td:first")[options.treeColumn]).css('padding-left'), 10);
}
$(this).ttInitNode();
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 73.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!options.expandable || $(this)[0].className.search(options.childPrefix) == -1) {
if (isNaN(defaultPaddingLeft)) {
defaultPaddingLeft = parseInt($($(this).children('td:first')[options.treeColumn]).css('padding-left'), 10);
}
$(this).ttInitNode();
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 73.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
node.ttChildren().each(function () {
$(this).ttRemoveSubtree();
$(this).remove();
});
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
node.ttChildren().each(function () {
$(this).ttInitNode();
$(this).show();
});
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76