matteomanzo/Playlister

View on GitHub

Showing 4 of 10 total issues

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

module.exports = function(grunt){

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

Severity: Major
Found in Gruntfile.js - About 2 hrs to fix

    Function authorizeSpotifyCallback has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.authorizeSpotifyCallback = function(req, res) {
      // your application requests refresh and access tokens
      // after checking the state parameter
      var code = req.query.code || null;
      var state = req.query.state || null;
    Severity: Minor
    Found in models/partyPlannerModel.js - About 1 hr to fix

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

      exports.songs = function(res, beaconMinor, beaconMajor, email, action) {
      Severity: Minor
      Found in models/mobileAppSongsModel.js - About 35 mins to fix

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

        var returnSongChoices = function(err, doc) {
          helpersDatabase.errorHandling(err);
          if (doc.length === 0) {
            outputRes.jsonp({confirmation: 'Sorry we could not find any songs for you'});
          }
        Severity: Minor
        Found in models/mobileAppSongsModel.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