-
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
AfO Register #398
AfO Register #398
Conversation
</HeadTagsService> | ||
)} | ||
{...(sitemap && sitemapDefaults)} | ||
/>, | ||
<Route |
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.
} & RouteComponentProps): JSX.Element { | ||
const rawQuery = parse(location.search).query || '' | ||
const query = _.isArray(rawQuery) ? rawQuery.join('') : rawQuery | ||
return ( | ||
<> |
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.
}) | ||
|
||
describe('Converts to Markdown string', () => { | ||
it('Returns the correct markdown string with fragments', () => { |
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.
}) | ||
|
||
describe('Finds link to fragment', () => { | ||
it('should return the correct link to fragment', () => { |
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.
this.apiClient = apiClient | ||
} | ||
|
||
search(query: string): Promise<AfoRegisterRecord[]> { |
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.
}} | ||
id={_.uniqueId('Bibliography-')} | ||
> | ||
<Tab |
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 { text: text ?? '', textNumber: textNumber ?? '' } | ||
} | ||
|
||
function BibliographyReferences({ |
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/bibliography/ui/Bibliography.tsx
Outdated
) | ||
} | ||
|
||
function AfoRegister({ |
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.
{...props} | ||
/> | ||
</Tab> | ||
<Tab |
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.
this.props.history.push(`?${stringify(this.state.query)}`) | ||
} | ||
|
||
render() { |
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 render
has 35 lines of code (exceeds 25 allowed). Consider refactoring.
.then((result) => result.map(createAfoRegisterRecord)) | ||
} | ||
|
||
searchSuggestions(query: string): Promise<AfoRegisterRecordSuggestion[]> { |
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.
import { stringify } from 'query-string' | ||
import MarkdownAndHtmlToHtml from 'common/MarkdownAndHtmlToHtml' | ||
|
||
export const AfoRegisterRedirectBox = ( |
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.
afoRegisterService: AfoRegisterService | ||
} & RouteComponentProps | ||
|
||
function AfoRegisterSearch({ queryProp, afoRegisterService }: FormProps) { |
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 AfoRegisterSearch
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
afoRegisterService={afoRegisterService} | ||
/> | ||
</div> | ||
<div className="AfoRegister__search_results"> |
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 4 locations. Consider refactoring.
readonly discussedByNotes?: string | ||
readonly fragmentNumbers?: string[] | ||
|
||
constructor({ |
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.
this.fragmentNumbers = fragmentNumbers | ||
} | ||
|
||
toMarkdownString(): 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 toMarkdownString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
src/afo-register/domain/Record.ts
Outdated
} | ||
|
||
toMarkdownString(): string { | ||
let result = this.text + (this.textNumber ? ' ' + this.textNumber : '') |
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.
I recently made a little helper function padLeft
in src/fragmentarium/domain/archaeology.ts because I had to do the x ? ' ' + x : ''
thing over and over, which is then just padLeft(this.textNumber)
. If you like you can move it to common/utils.ts or something and use it here, it might lower the complexity a bit.
Code Climate has analyzed commit 43c19d8 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 89.7% (75% is the threshold). This pull request will bring the total coverage in the repository to 90.8% (0.0% change). View more on Code Climate. |
No description provided.