colonizers/colonizers

View on GitHub

Showing 126 of 126 total issues

Avoid too many return statements within this function.
Open

  return this.players.find(player => player.id === userId);
Severity: Major
Found in packages/colonizers-client/lib/model/index.js - About 30 mins to fix

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

      render(options, tileset) {
        var tileStyle = tileset.tiles[options.type];
        var tileSpacing = tileset.board.tilespacing || 8;
        var hexagonOpts = this.getHexOptions(
          tileStyle,
    Severity: Minor
    Found in packages/colonizers-client/lib/game/hex-tile.js - 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

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

    UserInterface.prototype.onTurnStart = function() {
      if (!this.viewModel.myTurn) {
        return;
      }
    
    
    Severity: Minor
    Found in packages/colonizers-client/lib/user-interface.js - 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

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

    exports.register = function(server, options, next) {
      server.route({
        method: 'GET',
        path: '/logout',
        config: {
    Severity: Minor
    Found in packages/colonizers/server/web/login/index.js - 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

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

    function defineObservableProperty(obj, propertyName, value) {
      var isComputed = typeof value === 'function';
      var isArray = Array.isArray(value);
      var observable;
    
    
    Severity: Minor
    Found in packages/colonizers-client/lib/game/observable-properties.js - 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

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

    function defineObservableProperties(obj, properties) {
      obj._observables = obj._observables || {};
    
      if (!obj.getObservable) {
        obj.getObservable = function getObservable(observableName) {
    Severity: Minor
    Found in packages/colonizers-client/lib/game/observable-properties.js - 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