elwayman02/ember-data-echonest

View on GitHub

Showing 5 of 7 total issues

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

    normalizeResponse(store, primaryModelClass, payload, id, requestType) {
        const key = this.get('modelKey');
        const payloadKey = this.payloadKey(key);
        if (isPresent(key) && isPresent(payload.response)) {
            let response = payload.response[payloadKey];
Severity: Minor
Found in addon/serializers/echonest.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 buildURL has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    buildURL(modelName, id, snapshot, requestType, query) {
Severity: Minor
Found in addon/adapters/echonest.js - About 35 mins to fix

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

        buildURL(modelName, id, snapshot, requestType, query) {
    Severity: Minor
    Found in addon/adapters/echonest-song.js - About 35 mins to fix

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

          buildURL(modelName, id, snapshot, requestType, query) {
      Severity: Minor
      Found in addon/adapters/echonest-description.js - About 35 mins to fix

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

            normalizeResponse(store, primaryModelClass, payload, id, requestType) {
        Severity: Minor
        Found in addon/serializers/echonest.js - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language