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');
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
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');
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');
- 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
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');
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');
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
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');
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
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 {
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');
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 */
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 {
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)'},
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
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
- 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
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');
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');
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');
- 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
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)'},
- 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"