Showing 98 of 283 total issues
File filesystem.ts
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as cbor from "@ipld/dag-cbor"
import * as uint8arrays from "uint8arrays"
import { CID } from "multiformats/cid"
import { throttle } from "throttle-debounce"
File blocklist.ts
has 551 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Blocklist for usernames.
*
* Keep in sync with the Fission API.
* https://github.com/fission-suite/fission/blob/master/library/Fission/User/Username/Validation.hs
Function createProducer
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
export const createProducer = async (
dependencies: Dependencies,
options: { username: string }
): Promise<AccountLinkingProducer> => {
const { username } = options
- 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 PrivateTree.ts
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Uint8arrays from "uint8arrays"
import * as Crypto from "../../components/crypto/implementation.js"
import * as Depot from "../../components/depot/implementation.js"
import * as History from "./PrivateHistory.js"
File tree.ts
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as DagCBOR from "@ipld/dag-cbor"
import * as Uint8arrays from "uint8arrays"
import { CID } from "multiformats/cid"
import { BareNameFilter } from "../protocol/private/namefilter.js"
Function symlink
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
async symlink(args: {
at: Path.Directory<Partitioned<Partition>>
referringTo: {
path: Path.Distinctive<Partitioned<Partition>>
username?: 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
File consumer.test.ts
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Uint8arrays from "uint8arrays"
import expect from "expect"
import * as DID from "../did/index.js"
import * as Consumer from "./consumer.js"
File index.node.test.ts
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
import expect from "expect"
import * as fc from "fast-check"
import * as Path from "./index.js"
import { DirectoryPath, FilePath, RootBranch } from "./index.js"
File PublicRootWasm.ts
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CID } from "multiformats"
import { default as init, PublicDirectory, PublicFile, PublicNode } from "wnfs"
import * as Depot from "../../components/depot/implementation.js"
import * as Manners from "../../components/manners/implementation.js"
Function createConsumer
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const createConsumer = async (
dependencies: Dependencies,
options: { username: string }
): Promise<AccountLinkingConsumer> => {
const { username } = options
- 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 createProducer
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createProducer = async (
dependencies: Dependencies,
options: { username: string }
): Promise<AccountLinkingProducer> => {
const { username } = options
Function write
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
async write(
path: Path.Distinctive<Partitioned<Partition>>,
content: Uint8Array | SoftLink | SoftLink[] | Record<string, SoftLink>,
options: MutationOptions = {}
): Promise<this> {
- 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 createConsumer
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createConsumer = async (
dependencies: Dependencies,
options: { username: string }
): Promise<AccountLinkingConsumer> => {
const { username } = options
FileSystem
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
export class FileSystem implements API {
account: AssociatedIdentity
dependencies: Dependencies
eventEmitter: EventEmitter<Events.FileSystem>
File PublicTree.ts
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CID } from "multiformats/cid"
import * as Common from "../../common/index.js"
import * as Check from "../types/check.js"
import * as Depot from "../../components/depot/implementation.js"
Function write
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
async write(
path: Path.Distinctive<Partitioned<Partition>>,
content: Uint8Array | SoftLink | SoftLink[] | Record<string, SoftLink>,
options: MutationOptions = {}
): Promise<this> {
Function listen
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function listen(connection: Connection, config: Config): Listeners {
async function handleLocalChange(params: { root: CID; path: DistinctivePath<[ Partition, ...string[] ]> }) {
const { root, path } = params
const state = await getState(config)
PrivateTree
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
export default class PrivateTree extends BaseTree {
crypto: Crypto.Implementation
depot: Depot.Implementation
manners: Manners.Implementation
File node.ts
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
(づ ̄ ³ ̄)づ
IPFS node things.
Function handleMessage
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleMessage = async (event: MessageEvent): Promise<void> => {
const { data } = event
const message = data.arrayBuffer ? new TextDecoder().decode(await data.arrayBuffer()) : data
switch (ls.step) {