Showing 80 of 224 total issues
LineTask
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
type LineTask struct {
Base
Persistence
TaskType LineTaskType `gorm:"not null" json:"type"`
Function useTask
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useTask = <I, O>(
task: Task<I, O>,
handlers?: TaskHandler<I, O>
): Handlers<I> => {
const [, maintain] = useContext(OperationContext);
Function usePinch
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const usePinch = () => {
const model = useContext(ModelContext);
const [pressed, setPressed] = useState(false);
const [start, setStart] = useState(ZERO);
const [now, setNow] = useState(ZERO);
Function useCoord
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useCoord = (): CoordState => {
const [{ min_scale, max_scale }] = useContext(ConfigContext);
const [w, h] = useContext(WindowContext);
const pixi = useContext(PixiContext);
Function useSwipe
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useSwipe = () => {
const model = useContext(ModelContext);
const reload = useReload();
const [pressed, setPressed] = useState(false);
const [start, setStart] = useState(ZERO);
Function default
has a Cognitive Complexity of 17 (exceeds 5 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"));
- 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 useCache
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const useCache = <T>(
onGrace: (key: string, data: T) => void = () => {},
onExpired: (key: string, data: T) => void = () => {},
activeTime: number = ACTIVE,
graceTime: number = GRACE
- 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 setupUpdateCallback
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupUpdateCallback() {
super.setupUpdateCallback();
this.addUpdateCallback("delegate", () => this.refreshChildren());
this.addUpdateCallback("coord", (v: Coordinates) => {
let nowChunk = getChunkByPos(
Function init
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
init() {
let textures = this.model.app.loader.resources;
let props = {
model: this.model,
app: this.model.app,
Function setupRouter
has 72 lines of code (exceeds 50 allowed). Consider refactoring. Open
func setupRouter(secret string) *gin.Engine {
binding.Validator = new(v1.DefaultValidator)
router := gin.New()
router.Use(gin.Recovery())
Function useServerMap
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useServerMap = (
key: string,
keyAll: string[],
put: (key: string, value: CoreMap) => void,
graceHandler: GraceHandler
Function setCenter
has 42 lines of code (exceeds 25 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,
Function useCursor
has a Cognitive Complexity of 13 (exceeds 5 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);
- 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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const useDrag = () => {
const model = useContext(ModelContext);
const reload = useReload();
const [pressed, setPressed] = useState(false);
const [start, setStart] = useState(ZERO);
- 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 useSwipe
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const useSwipe = () => {
const model = useContext(ModelContext);
const reload = useReload();
const [pressed, setPressed] = useState(false);
const [start, setStart] = useState(ZERO);
- 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 CustomName
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CustomName = () => {
if (settings === undefined) {
return null;
}
return (
Function useCounter
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useCounter = (
pixi: PIXI.Application,
fn: Counter,
interval: number,
repeat: boolean = false
Function init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
init() {
let textures = this.model.app.loader.resources;
let base = {
model: this.model,
app: this.model.app
Function hueToRgb
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function hueToRgb(H: number) {
let S = config.hsv.saturation;
let V = config.hsv.value;
let C = V * S;
let Hp = H / 60;
Function default
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function() {
const theme = useTheme();
const classes = useStyles(theme);
const [id, setUserID] = React.useState("");
const [password, setPassword] = React.useState("");
- 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"