Showing 65 of 766 total issues
`` has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Annotation extends Component {
static propTypes = {
innerRef: T.func,
onMouseUp: T.func,
onMouseDown: T.func,
Function getTransliterationText
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
function getTransliterationText(
el: HTMLElement | Text | Comment | Document,
doc: jsPDF,
xPos: number,
yPos: number,
- 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
FakeApi
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class FakeApi {
private expectations: Expectation[] = []
readonly client = {
fetchJson: jest.fn().mockImplementation((path, authenticate) => {
File mapTokensToAnnotationTokens.test.ts
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { AnnotationToken } from 'fragmentarium/domain/annotation-token'
import Annotation, {
AnnotationTokenType,
} from 'fragmentarium/domain/annotation'
import { Text } from 'transliteration/domain/text'
File museum.ts
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export const Museums = {
ANCIENT_CULTURES_CHICAGO: {
name:
'Institute for the Study of Ancient Cultures, West Asia & North Africa',
city: 'Chicago',
Function findChapterDisplay
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
findChapterDisplay(
id: ChapterId,
lines: readonly number[] = [],
variants: readonly number[] = []
): Bluebird<ChapterDisplay> {
File ChapterLines.tsx
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import produce, { castDraft, Draft } from 'immer'
import _ from 'lodash'
import React from 'react'
import { Button, Card, Col, Form, ListGroup } from 'react-bootstrap'
import ListForm from 'common/List'
Function InjectedApp
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function InjectedApp(): JSX.Element {
const authenticationService = useAuthentication()
const apiClient = new ApiClient(authenticationService, errorReporter)
const wordRepository = new WordRepository(apiClient)
const signsRepository = new SignRepository(apiClient)
Function dealWithFootNotesHtml
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function dealWithFootNotesHtml(
el: HTMLElement | Text | Comment | Document,
doc: jsPDF,
xPos: number,
yPos: number
Function listController
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function listController(ListView) {
return function ListController({
value,
children,
onChange,
Function signFactory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const signFactory = Factory.define<Sign>(() => {
return new Sign({
name: chance.pickone(['BA', 'BAD', 'BAR', 'PI']),
lists: chance.pickone([
[{ name: 'MESZL', number: '1' }],
Function automaticAlignment
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function automaticAlignment(
tokens: readonly (readonly AnnotationToken[])[],
annotation: Annotation,
annotations: readonly Annotation[]
): readonly Annotation[] {
Function wordExport
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function wordExport(
fragment: Fragment,
wordService: WordService,
jQueryRef: JQuery
): Promise<Document> {
Function withData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function withData<PROPS, GETTER_PROPS, DATA>(
WrappedComponent: React.ComponentType<WithData<PROPS, DATA>>,
getter: (props: PROPS & GETTER_PROPS) => Promise<DATA>,
config: Partial<Config<PROPS & GETTER_PROPS, DATA>> = {}
): React.ComponentType<PROPS & GETTER_PROPS> {
Function SignLogogramInfo
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SignLogogramInfo(schrammLogogram: string): JSX.Element {
return (
<Popover
id={_.uniqueId('LogogramInfo-')}
title="Logogram Info"
Function addGlossary
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addGlossary(
glossaryHtml: JQuery,
jQueryRef: JQuery,
yPos: number,
doc: any
Function handleSelection
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleSelection = (annotation: RawAnnotation | Annotation): void => {
const { geometry, data } = annotation
if (data) {
const selectedAnnotation = getSelectionById(data.id, annotations)
if (selectedAnnotation) {
Function dealWithGlossaryHtml
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function dealWithGlossaryHtml(
el: HTMLElement | Text | Comment | Document,
doc: jsPDF,
xPos: number,
yPos: number
Function getColumnSizes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getColumnSizes(
table: JQuery,
jQueryRef: JQuery,
outerPaddingForTable: number,
firstColumnMinWidth: number,
Function findChapterLine
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
findChapterLine(
id: ChapterId,
number: number,
variantNumber: number
): Bluebird<LineDetails> {