Showing 8 of 36 total issues
NanikaStorage
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
export class NanikaStorage extends NanikaBaseDirectory {
private static async _filterRemove(target: FileSystemObject, exceptPaths: string[]) {
let toRemoveChildren: FileSystemObject[];
try {
toRemoveChildren = await target.filteredChildrenAll(exceptPaths);
File nanika-storage.ts
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** 伺かに必要なストレージ操作を扱うディレクトリオブジェクト */
/** -- */ // doc comment が後にないとtypedocによってmoduleの情報が出力されないので
import {FileSystemObject} from "fso";
File nanika-container-directory.ts
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** 伺かのコンテナを扱うディレクトリオブジェクト */
/** -- */ // doc comment が後にないとtypedocによってmoduleの情報が出力されないので
import * as fs from "fs";
NanikaContainerSyncDirectory
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
export class NanikaContainerSyncDirectory extends NanikaContainerSyncEntry implements HasNanikaContainerInfoDirectory {
private _childrenCache: Array<NanikaContainerSyncDirectory | NanikaContainerSyncFile>;
private _childrenAllCache: NanikaContainerSyncFile[];
private _indexes: {[path: string]: number} = {};
NanikaContainerSyncFile
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export class NanikaContainerSyncFile extends NanikaContainerSyncEntry {
path: string;
private _content: Buffer | null;
private _stats: fs.Stats | null;
Function _mergeInstallDirectory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static async _mergeInstallDirectory( // sourceをFileSystemObjectに変換するための苦肉の策
source: HasNanikaContainerInfoDirectory | FileSystemObject, target: FileSystemObject, install: UkagakaInstallInfo,
) {
if (install.refresh) {
if (install.refreshundeletemask) {
- 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 _filterRemove
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static async _filterRemove(target: FileSystemObject, exceptPaths: string[]) {
let toRemoveChildren: FileSystemObject[];
try {
toRemoveChildren = await target.filteredChildrenAll(exceptPaths);
} catch (error) {
- 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 readFileSync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
readFileSync(options?: any): string | Buffer {
if (this._content == null) throw new Error("not found");
const encoding = options == null ? undefined :
typeof options === "string" ? options :
options.encoding as string | undefined;
- 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"