Showing 80 of 224 total issues
Function processMsg
has a Cognitive Complexity of 81 (exceeds 20 allowed). Consider refactoring. Open
func processMsg(msg *Operation) time.Time {
MuModel.Lock()
defer MuModel.Unlock()
lock := time.Now()
- 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 default
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(props: Attributes) {
const [opened, setOpened] = React.useState(false);
const theme = useTheme();
const classes = useStyles(theme);
const isFullScreen = useMediaQuery(theme.breakpoints.down("sm"));
Function default
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function() {
const theme = useTheme();
const classes = useStyles(theme);
const [opened, setOpened] = React.useState(false);
const [confirmMessage, setConfirmMessage] = React.useState("");
Function default
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function() {
const [opened, setOpened] = React.useState(false);
const theme = useTheme();
const classes = useStyles(theme);
const isFullScreen = useMediaQuery(theme.breakpoints.down("sm"));
Function useCursor
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useCursor = () => {
const model = useContext(ModelContext);
const [count, setCount] = useState(0);
const [client, setClient] = useState<Point>();
const [pressed, setPressed] = useState(false);
Function processMsg
has 143 lines of code (exceeds 50 allowed). Consider refactoring. Open
func processMsg(msg *Operation) time.Time {
MuModel.Lock()
defer MuModel.Unlock()
lock := time.Now()
Function CacheMap
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CacheMap = () => {
const theme = useTheme();
const classes = useStyles(theme);
const [{ min_scale, max_scale }] = useContext(ConfigContext);
const [coordX, coordY, coordS, , , update] = useContext(CoordContext);
Function useRail
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useRail = () => {
const model = useContext(ModelContext);
const [, reloadPlayers] = useContext(PlayerContext);
const resolve = useCallback((err: ResolveError) => {
Function useFlash
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const useFlash = <T>(
boundary: string[],
graceHandler: GraceHandler,
onPut: (k: string, v: T) => void = () => {},
onRemove: (k: string) => void = () => {},
- 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 rail.ts
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Monitorable, MonitorContainer } from "interfaces/monitor";
import {
AnimatedSpriteProperty,
cursorOpts,
AnimatedSpriteContainerProperty
Human
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
type Human struct {
Base
Persistence
Point
File border.ts
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { GraphicsModel, GraphicsContainer } from "./graphics";
import { Monitorable, MonitorContainer } from "interfaces/monitor";
import { BorderProperty, PIXIProperty } from "interfaces/pixi";
import {
config,
Function default
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function() {
const theme = useTheme();
const classes = useStyles(theme);
const [id, setUserID] = React.useState("");
const [password, setPassword] = React.useState("");
File Register.tsx
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from "react";
import { useDispatch, useSelector } from "react-redux";
import {
Button,
Theme,
Function useMultiTask
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useMultiTask = <I, O>(
task: Task<I, O>,
handlers?: MultiTaskHandler<I, O>
): Handlers<I> => {
const [, maintain] = useContext(OperationContext);
Function setCenter
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected setCenter(x: number, y: number) {
let short = Math.min(this.renderer.width, this.renderer.height);
let long = Math.max(this.renderer.width, this.renderer.height);
let shortRadius = Math.pow(
2,
- 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
`` has 26 functions (exceeds 20 allowed). Consider refactoring. Open
export default class implements Monitorable {
protected model: GameModel;
/**
* 監視対象プロパティ
*/
Function default
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function() {
const classes = useStyles();
const [opened, setOpened] = React.useState(false);
const theme = useTheme();
const isFullScreen = useMediaQuery(theme.breakpoints.down("sm"));
Function default
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export default function() {
const [opened, setOpened] = React.useState(false);
const theme = useTheme();
const classes = useStyles(theme);
const isFullScreen = useMediaQuery(theme.breakpoints.down("sm"));
- 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 useDrag
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useDrag = () => {
const model = useContext(ModelContext);
const reload = useReload();
const [pressed, setPressed] = useState(false);
const [start, setStart] = useState(ZERO);