Showing 127 of 127 total issues
Function mapStateToProps
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function mapStateToProps(state) {
const {
surveys: {
isBusy,
isSubmitting,
- 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 surveyBlueprintModel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function surveyBlueprintModel(thinky) {
const {r, type: {string, date, array}} = thinky
return {
name: 'SurveyBlueprint',
- 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 feedbackTypeModel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function feedbackTypeModel(thinky) {
const {r, type: {string, date}} = thinky
return {
name: 'FeedbackType',
- 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 questionResponsesForFormFields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function questionResponsesForFormFields(formFields, defaults) {
try {
if (!formFields) {
return null
}
Function responseModel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function responseModel(thinky) {
const {r, type: {string, date, any}} = thinky
return {
name: 'Response',
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {isBusy, currentUser, projects} = this.props
const projectData = projects.map(project => {
const cycle = project.cycle || {}
Function getProject
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function getProject(identifier) {
return {
variables: {identifier},
query: `
query ($identifier: String!) {
Function routes
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const routes = store => {
return (
<Route path="/" component={userIsAuthenticated(App)}>
<IndexRedirect to="/phases"/>
<Route path="/chapters" component={Blank}>
Function getField
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getField(type) {
switch (type) {
case 'TEXT':
return {
type: 'TEXT',
Function phaseModel
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function phaseModel(thinky) {
const {r, type: {string, date, number}} = thinky
return {
name: 'Phase',
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {users, activeUserIds} = this.props
const isReady = users && users.length > 0
if (!isReady) {
Function cycleModel
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function cycleModel(thinky) {
const {r, type: {string, number, date}} = thinky
return {
name: 'Cycle',
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
children,
active,
title,
Function findUserProjectEvaluations
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function findUserProjectEvaluations(userIdentifier, projectIdentifier) {
const user = await (typeof userIdentifier === 'string' ? Member.get(userIdentifier) : userIdentifier)
if (!user || !user.id) {
throw new LGBadRequestError(`User not found for identifier: ${userIdentifier}`)
}
Function chapterModel
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function chapterModel(thinky) {
const {r, type: {string, number, date, array}} = thinky
return {
name: 'Chapter',
Function validateNumberGroup
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function validateNumberGroup(values, options = {}) {
if (!values) {
if (options.required) {
return 'can\'t be blank'
}
- 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 buildSurvey
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildSurvey() {
beforeEach(function () {
this.buildSurvey = async function (surveyAttrs = {}) {
const descriptor = surveyAttrs.descriptor || RETROSPECTIVE_DESCRIPTOR
const cycleState = surveyAttrs.descriptor === WORK_PLAN_DESCRIPTOR ? GOAL_SELECTION : REFLECTION
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Flex flexDirection="column" className={styles.container}>
<Flex>
<Flex flexDirection="column" className={styles.sliderLeftCol}>
Function chapters
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function chapters(state = initialState, action) {
switch (action.type) {
case GET_CHAPTER_REQUEST:
case FIND_CHAPTERS_REQUEST:
case ADD_INVITE_CODE_TO_CHAPTER_REQUEST:
Function findPhaseSummaries
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function findPhaseSummaries() {
return {
variables: {},
query: `
query {