Showing 63 of 611 total issues
Function mapDispatchToProps
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapDispatchToProps = function(dispatch, ownProps) {
const { min, max } = ownProps
return {
onChange: function(formId, attribute, submodel, value) {
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const currentPage = `${this.props.controller}#${this.props.action}`
return (
<nav className="c-primary-nav">
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
pledge_id, forms, isPreview, userIsInitiator,
isDraft, activateAction, userConfirmed, renderReportForm, className,
showSignForm
Function mapStateToProps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = function(state, ownProps) {
const formId = ownProps.formId
const attrs = state.rform[ownProps.formId]
let errors = null
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { results, query, filter, resultCount, isLoading, onButtonClick } = this.props
const showMoreButton = resultCount > results.length
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
id, reason, created_at
} = this.props
Function lookup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
I18n.lookup = function(scope, options) {
options = this.prepareOptions(options);
var locales = this.locales.get(options.locale).slice()
, requestedLocale = locales[0]
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { imagePath, name, className, large } = this.props
const avatarName = `Avatar ${name}`
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Provider store={store}>
<div className="o-wrapper">
{/* Layout M */}
Function cropImage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cropImage(originalImg, crop, maxWidth, maxHeight) {
const
imageWidth = originalImg.naturalWidth,
imageHeight = originalImg.naturalHeight,
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { formData, isSubmitting, id, handleResponse } = this.props
return (
<Form
Function mapDispatchToProps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const mapDispatchToProps = function(dispatch, ownProps) {
const { min, max } = ownProps
return {
onChange: function(formId, attribute, submodel, value) {
- 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 calculateDefaultCrop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function calculateDefaultCrop(imgWidth, imgHeight, cropAspectRatio) {
let cropWidth, cropHeight, cropX, cropY
const imageAspectRatio = imgWidth / imgHeight
if (imgWidth > imgHeight) {
- 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 fetchMoreResults
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function fetchMoreResults (dispatch, query, filter, offset, limit) {
Method to_one
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.to_one mailer_class, mailing_name, recipient, time, *mailing_args
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
imageState, originalImage, originalImageWidth, originalImageHeight, filename,
crop, croppedImageUrl, previewArea, onDropFile, handleChangeCrop,
handleFinishCrop, onCancelClick, onRemoveFileClick, className, type
- 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 mapStateToProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const mapStateToProps = function(state, ownProps) {
const formId = ownProps.formId
const attrs = state.rform[ownProps.formId]
let errors = null
- 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 _nameOrAnonymous
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
get _nameOrAnonymous() {
let string
if (this.props.anonymous && !this.props.showPrivateData) {
string = this.t('.anonymous')
}
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { results, query, filter, resultCount, isLoading, onButtonClick } = this.props
const showMoreButton = resultCount > results.length
- 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 mapStateToProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mapStateToProps = function(state, ownProps) {
const attrs = state.rform[ownProps.formId]
let value = ''
if (attrs && ownProps.submodel && attrs[ownProps.submodel]) {
- 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"