jplusplus/the-accountant

View on GitHub

Showing 27 of 35 total issues

Function gameService has 247 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function gameService($log, $rootScope, Step, Var, Ending, Character, I18n, memoizeMixin) {
  // Symbols declarion for private attributes and methods
  const _meta = Symbol('meta');
  const _vars = Symbol('vars');
  const _history = Symbol('history');
Severity: Major
Found in src/components/game/game.service.js - About 1 day to fix

    Game has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

      class Game {
        constructor(meta) {
          // Load meta data
          this[_meta] = angular.copy(meta || game);
          // Build step using meta data
    Severity: Major
    Found in src/components/game/game.service.js - About 7 hrs to fix

      Function StepService has 112 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function StepService(Choice, Slice, Stack, I18n, Explainer, $rootScope, $log) {
        // Symbols declarion for private attributes and methods
        const _meta = Symbol('meta');
        const _game = Symbol('game');
      
      
      Severity: Major
      Found in src/components/step/step.service.js - About 4 hrs to fix

        Function gameService has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        function gameService($log, $rootScope, Step, Var, Ending, Character, I18n, memoizeMixin) {
          // Symbols declarion for private attributes and methods
          const _meta = Symbol('meta');
          const _vars = Symbol('vars');
          const _history = Symbol('history');
        Severity: Minor
        Found in src/components/game/game.service.js - About 4 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 StackService has 99 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function StackService(Slice, I18n) {
          // Symbols declarion for private attributes and methods
          const _meta = Symbol('meta');
          const _slice = Symbol('slice');
          const _parent = Symbol('parent');
        Severity: Major
        Found in src/components/stack/stack.service.js - About 3 hrs to fix

          Function ChartService has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function ChartService($filter, I18n, memoizeMixin) {
            // Symbols declarion for private attributes and methods
            const _game = Symbol('game');
            const _id = Symbol('id');
          
          
          Severity: Major
          Found in src/components/chart/chart.service.js - About 2 hrs to fix

            Function controller has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              controller($state, $scope, $timeout, hotkeys, $transitions, $localForage, $translate) {
                $translate.use('en');
                // Method to start a new party
                this.playAgain = this.start = () => {
                  // Simply create a new instance of game
            Severity: Major
            Found in src/containers/main/main.js - About 2 hrs to fix

              Function ChoiceService has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function ChoiceService(Slice, Stack) {
                // Symbols declarion for private attributes and methods
                const _meta = Symbol('meta');
                const _step = Symbol('step');
                const _consequences = Symbol('consequences');
              Severity: Major
              Found in src/components/choice/choice.service.js - About 2 hrs to fix

                Step has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                  class Step extends Stack {
                    constructor(meta, game) {
                      // Create slices using the parent constructor
                      super(meta.texts, game);
                      // Set private properties
                Severity: Minor
                Found in src/components/step/step.service.js - About 2 hrs to fix

                  Function I18nService has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function I18nService($translate, memoizeMixin) {
                    const _meta = Symbol('meta');
                    const _fields = Symbol('fields');
                  
                    class I18n {
                  Severity: Major
                  Found in src/components/i18n/i18n.service.js - About 2 hrs to fix

                    Function VarService has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function VarService(I18n) {
                      // Symbols declarion for private attributes and methods
                      const _meta = Symbol('meta');
                      const _game = Symbol('game');
                    
                    
                    Severity: Major
                    Found in src/components/var/var.service.js - About 2 hrs to fix

                      File game.service.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      export default gameService;
                      import _ from 'lodash';
                      import game from './game.json';
                      
                      /** @ngInject */
                      Severity: Minor
                      Found in src/components/game/game.service.js - About 2 hrs to fix

                        Function SliceService has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function SliceService(I18n) {
                          // Symbols declarion for private attributes and methods
                          const _stack = Symbol('stack');
                        
                          class Slice extends I18n {
                        Severity: Minor
                        Found in src/components/slice/slice.service.js - About 1 hr to fix

                          Function modernizrRun has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function modernizrRun($window) {
                            // Here are all the values we will test. If you want to use just one or two, comment out the lines of test you don't need.
                            const tests = [
                              // False positive in IE, supports SVG clip-path, but not on HTML element
                              {name: 'svg', value: 'url(#test)'},
                          Severity: Minor
                          Found in src/modernizr.js - About 1 hr to fix

                            Function routesConfig has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            module.exports.routesConfig = function routesConfig($stateProvider, $urlRouterProvider, $locationProvider) {
                              $locationProvider.html5Mode(false).hashPrefix('');
                              $urlRouterProvider.otherwise('/');
                            
                              $stateProvider
                            Severity: Minor
                            Found in src/routes.js - About 1 hr to fix

                              Function controller has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                                controller($state, $scope, $timeout, hotkeys, $transitions, $localForage, $translate) {
                                  $translate.use('en');
                                  // Method to start a new party
                                  this.playAgain = this.start = () => {
                                    // Simply create a new instance of game
                              Severity: Minor
                              Found in src/containers/main/main.js - About 1 hr 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 ExplainerService has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function ExplainerService(I18n) {
                                // Symbols declarion for private attributes and methods
                                const _open = Symbol('open');
                                const _step = Symbol('step');
                                const _ref = Symbol('ref');
                              Severity: Minor
                              Found in src/components/explainer/explainer.service.js - About 1 hr to fix

                                Function EndingService has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function EndingService(I18n) {
                                  // Symbols declarion for private attributes and methods
                                  const _meta = Symbol('meta');
                                  const _game = Symbol('game');
                                
                                
                                Severity: Minor
                                Found in src/components/ending/ending.service.js - About 1 hr to fix

                                  Function StackService has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function StackService(Slice, I18n) {
                                    // Symbols declarion for private attributes and methods
                                    const _meta = Symbol('meta');
                                    const _slice = Symbol('slice');
                                    const _parent = Symbol('parent');
                                  Severity: Minor
                                  Found in src/components/stack/stack.service.js - About 1 hr 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 modernizrRun has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function modernizrRun($window) {
                                    // Here are all the values we will test. If you want to use just one or two, comment out the lines of test you don't need.
                                    const tests = [
                                      // False positive in IE, supports SVG clip-path, but not on HTML element
                                      {name: 'svg', value: 'url(#test)'},
                                  Severity: Minor
                                  Found in src/modernizr.js - About 1 hr 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