oscarrenalias/yammer-rest-api-client-node

View on GitHub

Showing 5 of 13 total issues

Function doRequest has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    doRequest: function(endpoint, token, method, params, callback) {
        // so that it's possible to ignore the params parameter and provider the callback
        // in its place instead
        if(params instanceof Function) {
            callback = params;
Severity: Minor
Found in lib/base.js - About 1 hr to fix

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

    YammerAPI.addMethods = function(mappings, obj) {
        var httpFuncs = {
            "get": function() { return(this.doGet); },
            "post": function() { return(this.doPost); },
            "delete": function() { return(this.doDelete); },
    Severity: Minor
    Found in lib/base.js - About 1 hr to fix

      Function exports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(grunt) {  
        grunt.loadNpmTasks('grunt-jasmine-node-coverage');
        grunt.loadNpmTasks('grunt-contrib-jshint');
        grunt.initConfig({ 
          jasmine_node: {
      Severity: Minor
      Found in Gruntfile.js - About 1 hr to fix

        Function doRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            doRequest: function(endpoint, token, method, params, callback) {
                // so that it's possible to ignore the params parameter and provider the callback
                // in its place instead
                if(params instanceof Function) {
                    callback = params;
        Severity: Minor
        Found in lib/base.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 doRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            doRequest: function(endpoint, token, method, params, callback) {
        Severity: Minor
        Found in lib/base.js - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language