luhmann/hired

View on GitHub

Showing 11 of 51 total issues

Function reference has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

  reference(key: string) {
    const storageKey = this.getKeyName(key)

    return {
      set(value: string) {
Severity: Minor
Found in src/storage/localstorageRepository.ts - About 3 hrs 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

Function build has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function build(previousFileSizes) {
  console.log('Creating an optimized production build...');
  webpack(config).run((err, stats) => {
    if (err) {
      printErrors('Failed to compile.', [err]);
Severity: Major
Found in scripts/build.js - About 3 hrs to fix

    Function setupCompiler has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function setupCompiler(host, port, protocol) {
      // "Compiler" is a low-level interface to Webpack.
      // It lets us listen to some events and provide our own custom messages.
      compiler = webpack(config, handleCompile);
    
    
    Severity: Major
    Found in scripts/start.js - About 2 hrs to fix

      Function render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          if (!this.props.rootStore || !this.props.rootStore.projectListStore.hasProject(this.props.id)) {
            // tslint:disable-next-line
            this.props.rootStore && this.props.rootStore.uiStore.setError(true)
            return null
      Severity: Minor
      Found in src/containers/ProjectPage.tsx - About 1 hr to fix

        Function addMiddleware has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function addMiddleware(devServer) {
          // `proxy` lets you to specify a fallback server during development.
          // Every unrecognized request will be forwarded to it.
          var proxy = require(paths.appPackageJson).proxy;
          devServer.use(historyApiFallback({
        Severity: Minor
        Found in scripts/start.js - About 1 hr to fix

          Function printErrors has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function printErrors(summary, errors) {
            console.log(chalk.red(summary));
            console.log();
            errors.forEach(err => {
              let linePointer;
          Severity: Minor
          Found in scripts/build.js - About 1 hr to fix

            Function constructor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(rootStore: RootStore) {
                this.rootStore = rootStore
            
                this.instance = Router5(
                  ROUTES, {
            Severity: Minor
            Found in src/lib/router.ts - About 1 hr to fix

              Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  return (
                    <Root>
                      <HeaderSave
                        cancelHandler={this.cancelHandler}
              Severity: Minor
              Found in src/containers/ProjectAddPage.tsx - About 1 hr to fix

                Function reference has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  reference(key: string) {
                    const storageKey = this.getKeyName(key)
                
                    return {
                      set(value: string) {
                Severity: Minor
                Found in src/storage/localstorageRepository.ts - About 1 hr to fix

                  Function addMiddleware has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function addMiddleware(devServer) {
                    // `proxy` lets you to specify a fallback server during development.
                    // Every unrecognized request will be forwarded to it.
                    var proxy = require(paths.appPackageJson).proxy;
                    devServer.use(historyApiFallback({
                  Severity: Minor
                  Found in scripts/start.js - About 35 mins 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

                  Function renderCurrentView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    renderCurrentView() {
                      if (this.props.rootStore) {
                        switch (this.props.rootStore.uiStore.currentView.name) {
                          case (VIEW_NAMES.projectList):
                            return (
                  Severity: Minor
                  Found in src/containers/App.tsx - About 25 mins 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

                  Severity
                  Category
                  Status
                  Source
                  Language