-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colophons #462
Conversation
) | ||
} | ||
|
||
function ArchaeologyContents(props: TabsProps): JSX.Element { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
) | ||
} | ||
|
||
function ColophonContents(props: TabsProps): JSX.Element { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
}[name]() | ||
} | ||
|
||
function isTabDisabled({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
) | ||
} | ||
|
||
function DisplayContents(props: TabsProps): JSX.Element { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
src/colophons/ui/ColophonEditor.tsx
Outdated
isUncertain: boolean | ||
} | ||
|
||
interface Individual { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
src/colophons/ui/ColophonEditor.tsx
Outdated
OnlyColophon = 'Only Colophon', | ||
} | ||
|
||
enum ColophonType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
src/colophons/ui/ColophonEditor.tsx
Outdated
value={individual.name?.value ?? ''} | ||
onChange={(e) => onUpdate('name', 'value', e.target.value)} | ||
/> | ||
<Form.Control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
isUncertain: boolean | ||
} | ||
|
||
export interface Individual { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
return `${chance.sentence()}\n${chance.sentence()}` | ||
} | ||
|
||
export function fragmentCollection( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function fragmentCollection
has 30 lines of code (exceeds 25 allowed). Consider refactoring.
}: BrokenUncertainProps): JSX.Element { | ||
return ( | ||
<> | ||
<Form.Switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
onChange={(event) => setBroken(event.target.checked)} | ||
checked={isBroken} | ||
/> | ||
<Form.Switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -0,0 +1,277 @@ | |||
import React from 'react' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File ColophonEditorInputs.tsx
has 266 lines of code (exceeds 250 allowed). Consider refactoring.
const _individuals = | ||
individuals.length > 0 ? individuals : [new IndividualAttestation()] | ||
return ( | ||
<ListForm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
) | ||
} | ||
|
||
export const ColophonStatusInput = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
) | ||
} | ||
|
||
export const ColophonOwnershipInput = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
}) | ||
} | ||
|
||
setTypeField(type?: IndividualTypeAttestation): IndividualAttestation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 5 locations. Consider refactoring.
index: number | ||
}): JSX.Element => { | ||
const nameFields = ['name', 'sonOf', 'grandsonOf', 'family'] | ||
const getSelectField = (props, key: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function getSelectField
has 45 lines of code (exceeds 25 allowed). Consider refactoring.
} | ||
} | ||
|
||
const IndividualForm = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function IndividualForm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
}) | ||
} | ||
|
||
toString(): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function toString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
}) | ||
} | ||
} | ||
const individualFields = [...nameFields, 'nativeOf', 'type'].map((key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function individualFields
has 39 lines of code (exceeds 25 allowed). Consider refactoring.
@@ -0,0 +1,336 @@ | |||
import React, { useState } from 'react' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File ColophonEditor.tsx
has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Code Climate has analyzed commit 8afc586 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 89.9% (75% is the threshold). This pull request will bring the total coverage in the repository to 91.0% (0.0% change). View more on Code Climate. |
No description provided.