joshuaferrara/node-csgo

View on GitHub

Showing 13 of 13 total issues

Function onSteamLogOn has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var onSteamLogOn = function onSteamLogOn(response){
        if (response.eresult == Steam.EResult.OK) {
            util.log('Logged in!');
        }
        else
Severity: Major
Found in example/example.js - About 2 hrs to fix

    Function CSGOClient has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var CSGOClient = function CSGOClient(steamUser, steamGC, debug) {
      EventEmitter.call(this);
    
      this.debug = debug || false;
      this._user = steamUser;
    Severity: Major
    Found in index.js - About 2 hrs to fix

      Function decoded_code has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          get decoded_code() {
              var self = this;
              var result = new Array(18).fill(0);
              var reversed = this.code.split('').reverse();
              reversed.forEach(function(char, index) {
      Severity: Minor
      Found in helpers/sharecode.js - About 1 hr to fix

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

        exports.decode = function(buffer) {
            var object = {};
            if(typeof(buffer.readUint8) != "function"){
                buffer = ByteBuffer.wrap(buffer);
            }
        Severity: Minor
        Found in helpers/VDF.js - About 1 hr to fix

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

          var CSGOClient = function CSGOClient(steamUser, steamGC, debug) {
            EventEmitter.call(this);
          
            this.debug = debug || false;
            this._user = steamUser;
          Severity: Minor
          Found in index.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 decode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.decode = function(buffer) {
              var object = {};
              if(typeof(buffer.readUint8) != "function"){
                  buffer = ByteBuffer.wrap(buffer);
              }
          Severity: Minor
          Found in helpers/VDF.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 requestRecentGames has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          CSGO.CSGOClient.prototype.requestRecentGames = function(arg1, arg2) {
            if (!this._gcReady) {
              if (this.debug) {
                util.log("GC not ready");
              }
          Severity: Minor
          Found in handlers/match.js - About 1 hr to fix

            Function gcClientConnectionStatus has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            handlers[protos.GC.CSGO.Internal.EGCBaseClientMsg.k_EMsgGCClientConnectionStatus] = function gcClientConnectionStatus(message) {
              /* Catch and handle changes in connection status, cuz reasons u know. */
            
              var status = protos.GC.CSGO.Internal.CMsgConnectionStatus.decode(message).status;
            
            
            Severity: Minor
            Found in index.js - About 55 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 requestRecentGames has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            CSGO.CSGOClient.prototype.requestRecentGames = function(arg1, arg2) {
              if (!this._gcReady) {
                if (this.debug) {
                  util.log("GC not ready");
                }
            Severity: Minor
            Found in handlers/match.js - About 55 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 requestGame has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            CSGO.CSGOClient.prototype.requestGame = function(matchid, outcome, token, callback) {
              callback = callback || null;
              if (!this._gcReady) {
                if (this.debug) {
                  util.log("GC not ready");
            Severity: Minor
            Found in handlers/match.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 onSteamLogOn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            var onSteamLogOn = function onSteamLogOn(response){
                    if (response.eresult == Steam.EResult.OK) {
                        util.log('Logged in!');
                    }
                    else
            Severity: Minor
            Found in example/example.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 playerProfileRequest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            CSGO.CSGOClient.prototype.playerProfileRequest = function(accountId, req_level, callback) {
              callback = callback || null;
              if (!this._gcReady) {
                if (this.debug) {
                  util.log("GC not ready");
            Severity: Minor
            Found in handlers/player.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 _encode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function _encode(object, buffer, name){
                switch (typeof object) {
                    case 'object':
                        buffer.writeByte(Type.None);
                        buffer.writeCString(name);
            Severity: Minor
            Found in helpers/VDF.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