Showing 127 of 127 total issues
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {projectData, projectModel, allowImport, onClickImport} = this.props
const header = (
<ContentHeader
title="Projects"
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {users, isBusy, currentUser} = this.props
const userData = users.map(user => {
const userURL = userCan(currentUser, 'viewUser') ?
Function surveyModel
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function surveyModel(thinky) {
const {r, type: {string, date, array}} = thinky
return {
name: 'Survey',
Function generateReport
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function generateReport(user) {
const projects = await findUserProjects(user.id)
return Promise.reduce(projects, async (result, project) => {
const {cycle} = project
Function projects
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function projects(state = initialState, action) {
switch (action.type) {
case FIND_PROJECTS_REQUEST:
case GET_PROJECT_REQUEST:
case DELETE_PROJECT_REQUEST:
Function projectSummaries
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function projectSummaries(state = initialState, action) {
switch (action.type) {
case GET_PROJECT_SUMMARY_REQUEST:
return Object.assign({}, state, {
isBusy: true,
Function mapStateToProps
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mapStateToProps(state, props) {
const {identifier} = props.params
const {isBusy, chapters} = state.chapters
const chapter = chapters[identifier] || Object.values(chapters).find(c => c.name === identifier)
Function graphQLFetcher
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function graphQLFetcher(baseURL, lgJWT = serverToServerJWT()) {
return graphQLParams => {
const options = {
method: 'post',
headers: {
Function memberModel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function memberModel(thinky) {
const {r, type: {string, date, array}} = thinky
return {
name: 'Member',
Function initializeChannel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default async function initializeChannel(name, {topic, users}) {
const chatService = require('src/server/services/chatService')
try {
await chatService.createChannel(name)
- 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 resolveFindProjectsForCycle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export async function resolveFindProjectsForCycle(source, args = {}, {currentUser}) {
if (!userCan(currentUser, 'findProjects')) {
throw new LGNotAuthorizedError()
}
- 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 app
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function app(state = initialState, action) {
switch (action.type) {
case APP_SHOW_LOADING:
return {...state, showLoading: true}
Function findUsers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function findUsers(identifiers) {
return {
variables: {identifiers},
query: `
query ($identifiers: [String]) {
Function buildSurvey
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.buildSurvey = async function (surveyAttrs = {}) {
const descriptor = surveyAttrs.descriptor || RETROSPECTIVE_DESCRIPTOR
const cycleState = surveyAttrs.descriptor === WORK_PLAN_DESCRIPTOR ? GOAL_SELECTION : REFLECTION
this.cycle = surveyAttrs.cycle || await factory.create('cycle', {state: cycleState})
this.cycleId = this.cycle.id
Function addInviteCodeToChapter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addInviteCodeToChapter(id, inviteCodeData) {
// because invite codes are stored in `idm` but chapter data lives in
// `echo`, we first need to create the invite code through `idm`, then
// associate it with the chapter in `echo`
return {
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {isBusy, chapters, currentUser} = this.props
if (chapters.length === 0 && isBusy) {
return null
Function define
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function define(factory) {
const commonAttrs = {
id: cb => cb(null, faker.random.uuid()),
name: factory.sequence(n => `funky-falcon-${n}`),
chapterId: factory.assoc('chapter', 'id'),
Function formFieldsForQuestionGroup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function formFieldsForQuestionGroup(questionGroup) {
try {
if (!questionGroup) {
return 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 findActiveProjectsForChapter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default async function findActiveProjectsForChapter(chapterId, options = {}) {
const latestCycle = await getLatestCycleForChapter(chapterId, {default: null})
if (!latestCycle) {
throw new LGInternalServerError(`Cycle not found for chapter ${chapterId}`)
}
- 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 _validateProject
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async function _validateProject(projectIdentifier, {chapter, cycle}) {
let project
if (projectIdentifier) {
project = await getProject(projectIdentifier)
if (project) {
- 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"