jaredhanson/passport-facebook

View on GitHub

Showing 5 of 9 total issues

Function userProfile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Strategy.prototype.userProfile = function(accessToken, done) {
  var url = uri.parse(this._profileURL);
  if (this._enableProof) {
    // Secure API call by adding proof of the app secret.  This is required when
    // the "Require AppSecret Proof for Server API calls" setting has been
Severity: Minor
Found in lib/strategy.js - About 1 hr to fix

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

    Strategy.prototype.userProfile = function(accessToken, done) {
      var url = uri.parse(this._profileURL);
      if (this._enableProof) {
        // Secure API call by adding proof of the app secret.  This is required when
        // the "Require AppSecret Proof for Server API calls" setting has been
    Severity: Minor
    Found in lib/strategy.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 FacebookGraphAPIError has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function FacebookGraphAPIError(message, type, code, subcode, traceID) {
    Severity: Minor
    Found in lib/errors/facebookgraphapierror.js - About 35 mins to fix

      Function FacebookTokenError has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function FacebookTokenError(message, type, code, subcode, traceID) {
      Severity: Minor
      Found in lib/errors/facebooktokenerror.js - About 35 mins to fix

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

        exports.parse = function(json) {
          if ('string' == typeof json) {
            json = JSON.parse(json);
          }
          
        Severity: Minor
        Found in lib/profile.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

        Severity
        Category
        Status
        Source
        Language