Showing 70 of 70 total issues
Function toggle
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dropdown.prototype.toggle = function (e) {
var $this = $(this);
if ($this.is('.disabled, :disabled')) return;
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.$selector1.css({
'top' : (this.$bar.position().top - 5) + 'px',
'border-color' : materialColors[this.color],
'background-color' : materialColors[this.color]
});
- Read upRead up
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 70.
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
this.$selector2.css({
'top' : (this.$bar.position().top - 5) + 'px',
'border-color' : materialColors[this.color],
'background-color' : materialColors[this.color]
});
- Read upRead up
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 70.
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
Function init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Range.prototype.init = function init(opts) {
opts = $.extend({}, opts, this.roundValues(opts.value1, opts.value2, opts));
if (!materialColors[opts.color]) {
this.color = 'indigo';
Similar blocks of code found in 4 locations. Consider refactoring. Open
if (this.prevX2 == 0) {
this.prevX2 = e.pageX;
this.left2 = +this.$selector2.css('left').replace('px', '');
}
- Read upRead up
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 64.
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 4 locations. Consider refactoring. Open
if (this.prevX == 0) {
this.prevX = e.pageX;
this.left = +this.$selector.css('left').replace('px', '');
}
- Read upRead up
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 64.
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 4 locations. Consider refactoring. Open
if (this.prevX1 == 0) {
this.prevX1 = e.pageX;
this.left1 = +this.$selector1.css('left').replace('px', '');
}
- Read upRead up
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 64.
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 4 locations. Consider refactoring. Open
if (this.prevX == 0) {
this.prevX = e.pageX;
this.left = +this.$selector.css('left').replace('px', '');
}
- Read upRead up
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 64.
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
Function events
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Selector.prototype.events = function events() {
this.$selector.bind('mousedown', function () {
this.mouseDown();
}.bind(this));
$(document).bind('mousemove', function (e) {
Function init
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Slider.prototype.init = function init(opts) {
var color = opts.color;
// controls on value
if (!opts.value) {
opts.value = opts.min;
Function Element
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Element(options) {
var defaultOptions = {
min : 0,
max : 100,
value : 0,
Function activate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active');
var transition = callback
&& $.support.transition
&& $active.hasClass('fade');
Function resizeSlider
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Range.prototype.resizeSlider = function resizeSlider() {
var originalWidth = this.$element.width(),
width = originalWidth;
// placement
Function create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Selector.prototype.create = function create() {
this.$element.addClass('material-slider ' + this.color);
if (this.opts.disabled === true) {
this.$element.addClass('disabled');
Function InputGroupFocus
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function InputGroupFocus(options) {
return this.each(function () {
var $this = $(this),
$addon = $this.find('.text-field-group-addon'),
$input = $this.find('input');
Function show
has 26 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 mouseMoveRight
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Range.prototype.mouseMoveRight = function mouseMoveRight(e) {
if (this.pressed2 === true && this.opts.disabled !== true) {
if (this.prevX2 == 0) {
this.prevX2 = e.pageX;
this.left2 = +this.$selector2.css('left').replace('px', '');
Function events
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Slider.prototype.events = function events() {
this.$selector.bind('mousedown', function () {
this.mouseDown();
}.bind(this));
$(document).bind('mousemove', function (e) {
Function mouseMoveLeft
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Range.prototype.mouseMoveLeft = function mouseMoveLeft(e) {
if (this.pressed1 === true && this.opts.disabled !== true) {
if (this.prevX1 == 0) {
this.prevX1 = e.pageX;
this.left1 = +this.$selector1.css('left').replace('px', '');
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Selector.prototype.init = function init(opts) {
opts.value = common.roundValue(opts.value, opts);
if (!materialColors[opts.color]) {
this.color = 'indigo';