Showing 118 of 280 total issues
File post_modal_content.js.jsx
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
const PostModalContent = React.createClass({
//BEGIN***************************************************DECLARE
propTypes: {
onChangeLink: React.PropTypes.func.isRequired,
addAttachment: React.PropTypes.func.isRequired,
Function getSortFunction
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Sifter.prototype.getSortFunction = function(search, options) {
var i, n, self, field, fields, fields_count, multiplier, multipliers, get_field, implicit_score, sort;
self = this;
search = self.prepareSearch(search, options);
Function Selectize
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Selectize = function($input, settings) {
var key, i, n, dir, input, self = this;
input = $input[0];
input.selectize = self;
Function validate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
validate: function(postData){
if (postData.type == PostTypes.quotation && !postData.title.trim() )
return false;
if (postData.type == PostTypes.photo && !postData.photos.length )
return false;
- 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
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var likes_count = this.props.likes;
var baskets_count = this.props.baskets_count;
var classname, classname_img;
var like_image_path, basket_image_path;
PostModalForm
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
const PostModalForm = React.createClass({
//BEGIN***************************************************DECLARE
propTypes: {
createPost: React.PropTypes.func.isRequired,
updatePost: React.PropTypes.func.isRequired
Function init_select
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
var init_select = function($input, settings_element) {
var i, n, tagName, $children, order = 0;
var options = settings_element.options;
var optionsMap = {};
Function mixin
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
MicroPlugin.mixin = function(Interface) {
Interface.plugins = {};
/**
* Initializes the listed plugins (with options).
Function getScoreFunction
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Sifter.prototype.getScoreFunction = function(search, options) {
var self, fields, tokens, token_count;
self = this;
search = self.prepareSearch(search, options);
File explore.js
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* cbpGridGallery.js v1.0.0
* http://www.codrops.com
*
* Licensed under the MIT license.
Function show
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
render: function() {
var main_part;
files = this.props.post.files.map(function (f, index) {
return (
<ModalContentFile
- 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
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
render(){
post = this.props.post;
var image, link_rendered;
switch (this.props.post.type) {
case PostTypes.link:
- 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
Function slide
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
var slide = function() {
// add class animatable to the slideshow grid
classie.addClass( self.slideshow, 'animatable' );
// overlays:
Function setActiveItem
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
setActiveItem: function($item, e) {
var self = this;
var eventName;
var i, idx, begin, end, item, swap;
var $last;
Function autoGrow
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
var autoGrow = function($input) {
var currentWidth = null;
var update = function(e, options) {
var value, keyCode, printable, placeholder, width;
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var className;
if (this.props.className) {
className = this.props.className;
Function users_list
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
var users_list = this.state.users.map(function(user){
var button, disabled;
if (user.checked) {
button =(
<button
Function deleteSelection
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
deleteSelection: function(e) {
var i, n, direction, selection, values, caret, option_select, $option_select, $tail;
var self = this;
direction = (e && e.keyCode === KEY_BACKSPACE) ? -1 : 1;
Function createPost
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
createPost: function(postData) {
var oldPosts = this.state.posts;
var newPost = [{
id: Date.now(),//random id for first
type: postData.type,