AlexRogalskiy/typescript-tools

View on GitHub

Showing 1,753 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

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        export const textDesktop = {
                            xxsmall: { height: '24px', size: '14px' },
                            xsmall: { height: '28px', size: '18px' },
                            small: { height: '30px', size: '20px' },
                            medium: { height: '40px', size: '28px' },
                        Severity: Major
                        Found in tools/theme.ts and 1 other location - About 1 day to fix
                        tools/theme.ts on lines 154..175

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 331.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        export const text = {
                            xxsmall: { height: '24px', size: '14px' },
                            xsmall: { height: '24px', size: '16px' },
                            small: { height: '28px', size: '18px' },
                            medium: { height: '32px', size: '22px' },
                        Severity: Major
                        Found in tools/theme.ts and 1 other location - About 1 day to fix
                        tools/theme.ts on lines 177..198

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 331.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language