AlexRogalskiy/typescript-tools

View on GitHub

Showing 670 of 1,753 total issues

File maths.ts has 2125 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Processor } from '../../typings/function-types'
import { Optional } from '../../typings/standard-types'

import { Checkers, Errors, Sorting, CommonUtils } from '..'

Severity: Major
Found in src/math/maths.ts - About 5 days to fix

    File strings.ts has 1690 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import _ from 'lodash'
    
    import { IOptions, Minimatch } from 'minimatch'
    import slugify from 'slugify'
    import cryptoRandomString from 'crypto-random-string'
    Severity: Major
    Found in src/types/strings.ts - About 4 days to fix

      File arrays.ts has 1569 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import _ from 'lodash'
      
      import { BiProcessor, Comparator, Consumer, Predicate, Processor } from '../../typings/function-types'
      
      import { Checkers, CommonUtils, Errors, Maths, Numbers, Objects, Sorting } from '..'
      Severity: Major
      Found in src/types/arrays.ts - About 4 days to fix

        File browsers.ts has 1412 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import 'jsdom-global/register'
        
        import { DomElement, Optional } from '../../typings/standard-types'
        import { Keys, Size } from '../../typings/general-types'
        
        
        Severity: Major
        Found in src/network/browsers.ts - About 3 days to fix

          File common-utils.ts has 1317 lines of code (exceeds 250 allowed). Consider refactoring.
          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'
          Severity: Major
          Found in src/utils/common-utils.ts - About 3 days to fix

            File matrices.ts has 1205 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Optional } from '../../typings/standard-types'
            import { Comparator } from '../../typings/function-types'
            
            import { Errors, Checkers, Comparators } from '..'
            
            
            Severity: Major
            Found in src/math/matrices.ts - About 3 days to fix

              Backlog has 154 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export default class Backlog extends Request {
                  /**
                   * https://developer.nulab.com/docs/backlog/api/2/get-space/
                   */
                  async getSpace(): Promise<any> {
              Severity: Major
              Found in src/network/backlog.ts - About 3 days to fix

                Function buildParsers has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring.
                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])))
                Severity: Minor
                Found in tools/parse-raw.js - About 2 days to fix

                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

                import { Checkers, Errors, Maths, Matrices } from '../src'
                
                import { Comparator } from '../typings/function-types'
                
                import Helpers = Maths.Helpers
                Severity: Major
                Found in tools/matrix.ts - About 2 days to fix

                  Function initArgs has 487 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function initArgs(argv: string[]): yargs.Argv<RawOptions> {
                      const sanitizedArgs = sanitizeArgs(argv);
                      const args = yargs(sanitizedArgs)
                          .scriptName('nativefier')
                          .usage(
                  Severity: Major
                  Found in src/constant/cli.ts - About 2 days to fix

                    File checkers.test.ts has 915 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { ALPHA_REGEX, ArrayBuffers, Checkers, Errors } from '../src'
                    import checkRange = Checkers.checkRange
                    
                    export namespace Checkers_Test {
                        import isInRange = Checkers.isInRange
                    Severity: Major
                    Found in tests/checkers.test.ts - About 2 days to fix

                      File regexes.ts has 804 lines of code (exceeds 250 allowed). Consider refactoring.
                      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'
                      Severity: Major
                      Found in src/types/regexes.ts - About 1 day to fix

                        File numbers.ts has 732 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { Optional } from '../../typings/standard-types'
                        
                        import { Checkers, Comparators, Errors } from '../index'
                        
                        export namespace Numbers {
                        Severity: Major
                        Found in src/types/numbers.ts - About 1 day to fix

                          Function buildParsers has 336 lines of code (exceeds 25 allowed). Consider refactoring.
                          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])))
                          Severity: Major
                          Found in tools/parse-raw.js - About 1 day to fix

                            File color-utils.ts has 724 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { Arrays, Checkers, CommonUtils, Errors, Numbers, Strings } from '..'
                            import { Optional } from '../../typings/standard-types'
                            
                            export namespace ColorsUtils {
                                import clamp = CommonUtils.clamp
                            Severity: Major
                            Found in src/utils/color-utils.ts - About 1 day to fix

                              File objects.ts has 693 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import _ from 'lodash'
                              
                              import { Keys, KeyValue, Values } from '../../typings/general-types'
                              import { ObjectMap, Optional } from '../../typings/standard-types'
                              
                              
                              Severity: Major
                              Found in src/types/objects.ts - About 1 day to fix

                                File files.ts has 687 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import hasha from 'hasha'
                                import mkdirp from 'mkdirp'
                                import dirSync from 'tmp'
                                import YAML from 'json2yaml'
                                import beautify from 'js-beautify'
                                Severity: Major
                                Found in src/types/files.ts - About 1 day to fix

                                  File backlog.ts has 680 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import * as Option from './option'
                                  import * as Entity from './entity'
                                  import Request from './request'
                                  
                                  export default class Backlog extends Request {
                                  Severity: Major
                                  Found in src/network/backlog.ts - About 1 day to fix

                                    Function valuesToSuggestions has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
                                    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))
                                    Severity: Minor
                                    Found in src/utils/common-utils.ts - About 1 day to fix

                                    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

                                    import _ from 'lodash'
                                    import minimatch from 'minimatch'
                                    
                                    import { Callback, Executor, GenericValueCallback, Processor, Supplier } from '../../typings/function-types'
                                    
                                    
                                    Severity: Major
                                    Found in src/types/functions.ts - About 1 day to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language