Showing 103 of 103 total issues
File holder.js
has 3089 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
Holder - client side image placeholders
Version 2.9.9+jl7z
© 2021 Ivan Malopinsky - https://imsky.co
Function buildSceneGraph
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildSceneGraph(scene) {
var fontSize = App.defaults.size;
var fixedSize = scene.flags.fixedSize != null ? scene.flags.fixedSize : scene.theme.fixedSize;
if (parseFloat(scene.theme.size)) {
fontSize = scene.theme.size;
Function shaven
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
function shaven(arrayOrObject) {
var isArray = Array.isArray(arrayOrObject);
var objType = typeof arrayOrObject === 'undefined' ? 'undefined' : _typeof(arrayOrObject);
if (!isArray && objType !== 'object') {
Function prepareDOMElement
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareDOMElement(prepSettings) {
var mode = prepSettings.mode;
var el = prepSettings.el;
var flags = prepSettings.flags;
var _engineSettings = prepSettings.engineSettings;
Function run
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
run: function(userOptions) {
//todo: split processing into separate queues
userOptions = userOptions || {};
var engineSettings = {};
var options = extend(App.settings, userOptions);
Function _onDomReady
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _onDomReady(win) {
//Lazy loading fix for Firefox < 3.6
//http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
if (document.readyState == null && document.addEventListener) {
document.addEventListener("DOMContentLoaded", function DOMContentLoaded() {
Function SceneGraph
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SceneGraph = function(sceneProperties) {
var nodeCount = 1;
//todo: move merge to helpers section
function merge(parent, child) {
Function buildDom
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildDom(elemArray) {
if (Array.isArray(elemArray) && elemArray.length === 0) {
// Ignore empty arrays
return {};
}
Class ProjectsController
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class ProjectsController < ApplicationController
before_action :find_project_by_id
before_action :redirect_to_slug, only: [:show]
load_and_authorize_resource find_by: :url
skip_before_action :authenticate_user!, only: %i[index show archived finished newest popular biggest random]
Function formatValue
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatValue(ctx, value, recurseTimes) {
// Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
if (ctx.customInspect &&
value &&
Function render
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function render(renderSettings) {
var image = null;
var mode = renderSettings.mode;
var el = renderSettings.el;
var holderSettings = renderSettings.holderSettings;
Function exports
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (sceneGraph, renderSettings) {
var engineSettings = renderSettings.engineSettings;
var stylesheets = engineSettings.stylesheets;
var stylesheetXml = stylesheets.map(function (stylesheet) {
return '<?xml-stylesheet rel="stylesheet" href="' + stylesheet + '"?>';
Identical blocks of code found in 3 locations. Consider refactoring. Open
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- 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 95.
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
Identical blocks of code found in 3 locations. Consider refactoring. Open
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- 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 95.
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
Identical blocks of code found in 3 locations. Consider refactoring. Open
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- 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 95.
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 stagingRenderer
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
var stagingRenderer = (function() {
var svg = null,
stagingText = null,
stagingTextNode = null;
return function(graph) {
Function parseURL
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseURL(url, instanceOptions) {
var holder = {
theme: extend(App.settings.themes.gray, null),
stylesheets: instanceOptions.stylesheets,
instanceOptions: instanceOptions
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (dimensions.height.slice(-1) == '%') {
el.style.height = dimensions.height;
} else if (flags.auto == null || !flags.auto) {
el.style.height = dimensions.height + '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 93.
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 (dimensions.width.slice(-1) == '%') {
el.style.width = dimensions.width;
} else if (flags.auto == null || !flags.auto) {
el.style.width = dimensions.width + '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 93.
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
Class Project
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Project < ApplicationRecord
include AASM
include Rails.application.routes.url_helpers
validates :title, :description, :originator, presence: true