angular/angular.js

View on GitHub
lib/versions/version-info.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function getCdnVersion has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

var getCdnVersion = function() {
  return _(previousVersions)
    .filter(function(tag) {
      return semver.satisfies(tag, currentPackage.branchVersion);
    })
Severity: Minor
Found in lib/versions/version-info.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 getPreviousVersions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var getPreviousVersions =  function() {
  // If we are allowing remote requests then use the remote tags as the local clone might
  // not contain all commits when cloned with git clone --depth=...
  // Otherwise just use the tags in the local repository
  var repo_url = currentPackage.repository.url;
Severity: Minor
Found in lib/versions/version-info.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if ((version.major === 1 && version.minor === 0 && version.prerelease.length > 0) || (version.major === 1 && version.minor === 2 && version.prerelease[0] === 'rc1')) {
              version.version = [version.major, version.minor, version.patch].join('.') + version.prerelease.join('');
              version.raw = 'v' + version.version;
            }
    Severity: Major
    Found in lib/versions/version-info.js - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status