zammad/zammad

View on GitHub
app/assets/javascripts/knowledge_base_public_polyfills/fetch.js

Summary

Maintainability
C
1 day
Test Coverage

File fetch.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// https://github.com/github/fetch

(function(self) {
  'use strict';

Severity: Minor
Found in app/assets/javascripts/knowledge_base_public_polyfills/fetch.js - About 5 hrs to fix

    Function Body has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function Body() {
        this.bodyUsed = false
    
        this._initBody = function(body) {
          this._bodyInit = body
    Severity: Major
    Found in app/assets/javascripts/knowledge_base_public_polyfills/fetch.js - About 3 hrs to fix

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

        self.fetch = function(input, init) {
          return new Promise(function(resolve, reject) {
            var request = new Request(input, init)
            var xhr = new XMLHttpRequest()
      
      
      Severity: Minor
      Found in app/assets/javascripts/knowledge_base_public_polyfills/fetch.js - About 1 hr to fix

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

          function Request(input, options) {
            options = options || {}
            var body = options.body
        
            if (input instanceof Request) {
        Severity: Minor
        Found in app/assets/javascripts/knowledge_base_public_polyfills/fetch.js - About 1 hr to fix

          Function _initBody has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this._initBody = function(body) {
                this._bodyInit = body
                if (!body) {
                  this._bodyText = ''
                } else if (typeof body === 'string') {
          Severity: Minor
          Found in app/assets/javascripts/knowledge_base_public_polyfills/fetch.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status