Showing 8 of 17 total issues
File Gallery.js
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React, {Component} from 'react';
import equal from 'fast-deep-equal';
import Engine, {
COLUMN_MAX_HEIGHT,
Function renderFixedGallery
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderFixedGallery({
className, fixedRows, rowClassName, columnClassName, imageRenderer, disableObserver, disableActualImage,
enableDetailView, detailsViewRenderer, fixedBottom, placeholderColor,
fixedBottomGutterInPecent, fixedImagePlaceholderColor,
}) {
Function renderGallery
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderGallery({
className, rows, rowClassName, columnClassName, imageRenderer, disableObserver, disableActualImage,
enableDetailView, detailsViewRenderer, disableLastRowDetecting, placeholderColor,
}) {
const {
Engine
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Engine {
static getMinHeight(items) {
return Math.min.apply(null,
(items.map(item => item.height)));
Function UNSAFE_componentWillMount
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
UNSAFE_componentWillMount() {
const {
images,
columnsMaxCount,
columnMaxWidth,
Function renderMasonryGallery
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderMasonryGallery({
className, columnClassName, imageRenderer, disableObserver, disableActualImage, columns,
placeholderColor,
}) {
return (
Function UNSAFE_componentWillReceiveProps
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
UNSAFE_componentWillReceiveProps(nextProps) {
if (!equal(this.props, nextProps)) {
this.engine
.setImages(nextProps.images)
Function Image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
const Image = ({
className,
src,
alt,
visible,
- 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"