Showing 103 of 127 total issues
Function RetroSurveyBody
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function RetroSurveyBody(props) {
const {
formName,
surveyFields,
handleSubmit,
Function groupSurveyQuestions
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function groupSurveyQuestions(questions) {
try {
const teamQuestionsByQuestionId = new Map()
const singleSubjectQuestionsBySubjectId = new Map()
Function getUserSummary
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function getUserSummary(identifier) {
return {
variables: {identifier},
query: `query ($identifier: String!) {
getUserSummary(identifier: $identifier) {
Function renderFieldInput
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderFieldInput(field) {
const {input: {onChange: handleChange}} = field
switch (field.type) {
case FORM_INPUT_TYPES.TEXT:
return (
Function getProjectSummary
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function getProjectSummary(identifier) {
return {
variables: {identifier},
query: `query ($identifier: String!) {
getProjectSummary(identifier: $identifier) {
Function questionModel
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function questionModel(thinky) {
const {r, type: {string, date, boolean, object}} = thinky
return {
name: 'Question',
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
name,
title,
handleSubmit,
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
handleSubmit,
submitting,
invalid,
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
title,
tabs,
tableModel,
Function WorkPlanSurveyForm
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function WorkPlanSurveyForm(props) {
const {
surveyShortTitle,
formName,
surveyGroupIndex,
Function projectModel
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function projectModel(thinky) {
const {r, type: {string, date, array}} = thinky
return {
name: 'Project',
Function findRetrospectiveSurveys
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function findRetrospectiveSurveys(filters) {
return {
variables: filters,
query: `
query {
Function getGraphQLFetcher
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function getGraphQLFetcher(dispatch, auth, baseUrl = process.env.APP_BASE_URL, throwErrors = true) {
dispatch(fetchDataRequest())
return graphQLParams => {
const options = {
method: 'post',
Function unlockSurvey
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function unlockSurvey(memberId, projectId) {
return {
variables: {memberId, projectId},
query: `
mutation($memberId: ID!, $projectId: ID!) {
Function lockSurvey
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function lockSurvey(memberId, projectId) {
return {
variables: {memberId, projectId},
query: `
mutation($memberId: ID!, $projectId: ID!) {
Function feedbackTypeModel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function feedbackTypeModel(thinky) {
const {r, type: {string, date}} = thinky
return {
name: 'FeedbackType',
Function mapStateToProps
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function surveyBlueprintModel(thinky) {
const {r, type: {string, date, array}} = thinky
return {
name: 'SurveyBlueprint',
Function RetroSurveyForm
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function RetroSurveyForm(props) {
const {
surveyTitle,
surveyShortTitle,
playbookURL,
Function handleRender
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function handleRender(req, res) {
try {
// we require() these rather than importing them because (in development)
// we may have flushed the require cache (when files change), but if we
// import them at the top, this module will still be holding references to