Showing 244 of 809 total issues
File set_latest_wargame_message_mock.ts
has 1785 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CHANNEL_CHAT, CHANNEL_CUSTOM, CUSTOM_MESSAGE, FEEDBACK_MESSAGE, PARTICIPANT_CHAT, PARTICIPANT_CUSTOM } from 'src/config'
import { PlayerUi } from 'src/custom-types'
const state: PlayerUi = {
selectedForce: undefined,
Function AdminGameSetup
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
const AdminGameSetup: React.FC = () => {
const dispatch = useDispatch()
const { wargame, messageTypes }: { wargame: WargamesState, messageTypes: MessageTypes } = useSelector(({ wargame, messageTypes }: RootState) => ({ wargame, messageTypes }))
const {
- 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
File message-templates.mock.ts
has 792 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { TemplateBody } from 'src/custom-types'
const messageTemplatesMock: TemplateBody[] = [
{
completed: false,
Function renderContent
has 299 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderContent = (): React.ReactNode => {
if (!localChannelUpdates) return null
const handleSaveRows = (participants: ParticipantCollab[]): void => {
const newChannel = { ...localChannelUpdates }
Function pouchDb
has 281 lines of code (exceeds 25 allowed). Consider refactoring. Open
const pouchDb = (app, io, pouchOptions) => {
const PouchDB = require('pouchdb-core')
.plugin(require('pouchdb-adapter-node-websql'))
.plugin(require('pouchdb-adapter-http'))
.plugin(require('pouchdb-mapreduce'))
File coa-messages.mock.ts
has 627 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CUSTOM_MESSAGE, CollaborativeMessageStates } from 'src/config'
import { MessageCustom, Role } from 'src/custom-types'
import { forces } from './forces.mock'
const whiteGC: Role = forces[0].roles[0]
Function JsonEditor
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
export const JsonEditor: React.FC<Props> = ({
messageId,
messageContent,
title,
template,
- 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 MappingPanel
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
export const MappingPanel: React.FC<MappingPanelProps> = ({ onClose, features, rendererProps, selected, onSelect, onSave, forceStyles }): React.ReactElement => {
const [filterredFeatures, setFilterredFeatures] = useState<FeatureCollection<Geometry, GeoJsonProperties> | undefined>(features)
const [pendingSaveFeatures, setPendingSaveFeatures] = useState<FeatureCollection<Geometry, GeoJsonProperties> | undefined>(features)
const [openAddFilter, setOpenAddFilter] = useState<boolean>(false)
const [propertyFiltersListPanel, setPropertyFiltersListPanel] = useState<string[]>([])
- 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 couchDb
has 270 lines of code (exceeds 25 allowed). Consider refactoring. Open
const couchDb = (app, io, pouchOptions) => {
const CouchDB = require('pouchdb-core')
const PouchDB = require('pouchdb-core')
.plugin(require('pouchdb-adapter-node-websql'))
.plugin(require('pouchdb-adapter-http'))
Function AdminGameSetup
has 252 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminGameSetup: React.FC = () => {
const dispatch = useDispatch()
const { wargame, messageTypes }: { wargame: WargamesState, messageTypes: MessageTypes } = useSelector(({ wargame, messageTypes }: RootState) => ({ wargame, messageTypes }))
const {
File index.ts
has 581 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable no-unused-vars */
import { ADJUDICATION_PHASE, allDbs, clearAll, COUNTER_MESSAGE, CUSTOM_MESSAGE, databasePath, FEEDBACK_MESSAGE, hiddenPrefix, INFO_MESSAGE, MSG_STORE, MSG_TYPE_STORE, PLANNING_PHASE, SERGE_INFO, serverPath, wargameSettings, dbDefaultSettings } from 'src/config'
import { deleteRoleAndParts, duplicateThisForce } from 'src/Helpers'
import _ from 'lodash'
import moment from 'moment'
Function SortableList
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
export const SortableList: React.FC<PropTypes> = React.forwardRef(({
onClick,
onChange,
items,
title = 'Add',
- 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 ReactTable
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ReactTable: React.FC<ReactTableProps> = (props) => {
const {
columns,
rows,
showArchived,
Function renderContent
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderContent = (): React.ReactNode => {
if (!localChannelUpdates) return null
const handleSaveRows = (participants: ParticipantChat[]): void => {
const newChannel = { ...localChannelUpdates }
Function CollabChannel
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export const CollabChannel: React.FC<CollabChannelProps> = ({
channel,
forces,
messageTemplates,
onChange
- 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 renderContent
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderContent = (): React.ReactNode => {
if (!localChannelUpdates) return null
const handleSaveRows = (participants: ParticipantCustom[]): void => {
const newChannel = { ...localChannelUpdates }
Function genData
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const genData = (
messages: MessageCustom[],
forces: ForceData[],
role: ForceRole,
templates: TemplateBodysByKey,
Function CustomChannel
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
export const CustomChannel: React.FC<CustomChannelProps> = ({
channel,
forces,
messageTemplates,
onChange
- 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
File index.tsx
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { faCircleArrowRight } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { Box, Button } from '@material-ui/core'
import Slide from '@mui/material/Slide'
import { Feature, FeatureCollection, GeoJsonProperties, Geometry } from 'geojson'
File index.tsx
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { faArrowAltCircleLeft, faWindowMaximize, faWindowMinimize } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { Checkbox, FormControlLabel } from '@material-ui/core'
import { Feature, FeatureCollection, GeoJsonProperties, Geometry } from 'geojson'
import { cloneDeep, get, isEqual, merge, set, uniq } from 'lodash'