angular/angular.js

View on GitHub
scripts/code.angularjs.org-firebase/functions/index.js

Summary

Maintainability
C
1 day
Test Coverage

Function sendStoredFile has 129 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function sendStoredFile(request, response) {
  // Request paths will be URI-encoded, so we need to decode them to match the file names in the
  // storage bucket. Failing to do so will result in a 404 error from the bucket and `index.html`
  // will be returned instead.
  // Example of path requiring decoding: `.../input%5Btext%5D.html` --> `.../input[text].html`
Severity: Major
Found in scripts/code.angularjs.org-firebase/functions/index.js - About 5 hrs to fix

    Function getDirectoryListing has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function getDirectoryListing(path) {
        if (!path.endsWith('/')) path += '/';
    
        const getFilesOptions = {
          delimiter: '/',
    Severity: Major
    Found in scripts/code.angularjs.org-firebase/functions/index.js - About 2 hrs to fix

      Function sendStoredFile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      function sendStoredFile(request, response) {
        // Request paths will be URI-encoded, so we need to decode them to match the file names in the
        // storage bucket. Failing to do so will result in a 404 error from the bucket and `index.html`
        // will be returned instead.
        // Example of path requiring decoding: `.../input%5Btext%5D.html` --> `.../input[text].html`
      Severity: Minor
      Found in scripts/code.angularjs.org-firebase/functions/index.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

      There are no issues that match your filters.

      Category
      Status