Showing 670 of 1,753 total issues
File maths.ts
has 2125 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Processor } from '../../typings/function-types'
import { Optional } from '../../typings/standard-types'
import { Checkers, Errors, Sorting, CommonUtils } from '..'
File strings.ts
has 1690 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash'
import { IOptions, Minimatch } from 'minimatch'
import slugify from 'slugify'
import cryptoRandomString from 'crypto-random-string'
File arrays.ts
has 1569 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash'
import { BiProcessor, Comparator, Consumer, Predicate, Processor } from '../../typings/function-types'
import { Checkers, CommonUtils, Errors, Maths, Numbers, Objects, Sorting } from '..'
File browsers.ts
has 1412 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import 'jsdom-global/register'
import { DomElement, Optional } from '../../typings/standard-types'
import { Keys, Size } from '../../typings/general-types'
File common-utils.ts
has 1317 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as _ from 'lodash'
import { isBoolean, isInteger, isNull, isNumber, isString, mergeWith, union } from 'lodash'
import { CpuInfo, cpus } from 'os'
import * as crypto from 'crypto'
import { randomBytes, scrypt } from 'crypto'
File matrices.ts
has 1205 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Optional } from '../../typings/standard-types'
import { Comparator } from '../../typings/function-types'
import { Errors, Checkers, Comparators } from '..'
Backlog
has 154 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class Backlog extends Request {
/**
* https://developer.nulab.com/docs/backlog/api/2/get-space/
*/
async getSpace(): Promise<any> {
Function buildParsers
has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function buildParsers(strictParser) {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const patch = (subject, patches) => {
// eslint-disable-next-line github/array-foreach
Object.entries(patches).forEach(([key, patch]) => (subject[key] = patch(subject[key])))
- 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 matrix.ts
has 1074 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Checkers, Errors, Maths, Matrices } from '../src'
import { Comparator } from '../typings/function-types'
import Helpers = Maths.Helpers
Function initArgs
has 487 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function initArgs(argv: string[]): yargs.Argv<RawOptions> {
const sanitizedArgs = sanitizeArgs(argv);
const args = yargs(sanitizedArgs)
.scriptName('nativefier')
.usage(
File checkers.test.ts
has 915 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { ALPHA_REGEX, ArrayBuffers, Checkers, Errors } from '../src'
import checkRange = Checkers.checkRange
export namespace Checkers_Test {
import isInRange = Checkers.isInRange
File regexes.ts
has 804 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _, {cloneDeep, merge} from 'lodash'
import {Keys, Pair} from '../../typings/general-types'
import {GradleDependency} from '../../typings/domain-types'
import {Optional} from '../../typings/standard-types'
File numbers.ts
has 732 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Optional } from '../../typings/standard-types'
import { Checkers, Comparators, Errors } from '../index'
export namespace Numbers {
Function buildParsers
has 336 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function buildParsers(strictParser) {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const patch = (subject, patches) => {
// eslint-disable-next-line github/array-foreach
Object.entries(patches).forEach(([key, patch]) => (subject[key] = patch(subject[key])))
File color-utils.ts
has 724 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Arrays, Checkers, CommonUtils, Errors, Numbers, Strings } from '..'
import { Optional } from '../../typings/standard-types'
export namespace ColorsUtils {
import clamp = CommonUtils.clamp
File objects.ts
has 693 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash'
import { Keys, KeyValue, Values } from '../../typings/general-types'
import { ObjectMap, Optional } from '../../typings/standard-types'
File files.ts
has 687 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import hasha from 'hasha'
import mkdirp from 'mkdirp'
import dirSync from 'tmp'
import YAML from 'json2yaml'
import beautify from 'js-beautify'
File backlog.ts
has 680 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as Option from './option'
import * as Entity from './entity'
import Request from './request'
export default class Backlog extends Request {
Function valuesToSuggestions
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
Open
export const valuesToSuggestions = (context, values, related): any => {
const suggestions = new Set()
const addValue = (value: any): any => {
if (typeof value === 'string') {
suggestions.add(JSON.stringify(value))
- 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 functions.ts
has 647 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash'
import minimatch from 'minimatch'
import { Callback, Executor, GenericValueCallback, Processor, Supplier } from '../../typings/function-types'