Showing 10 of 28 total issues
Function Agent
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Agent = (function (_super) {
__extends(Agent, _super);
function Agent(options) {
_super.call(this, options);
var xrw = 'x-requested-with';
Function Agent
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Agent = (function () {
function Agent(options) {
this.headers = {};
if (!options || !Object.keys(options).length) {
throw new Error('Missing options.');
Function Agent
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Agent = (function (_super) {
__extends(Agent, _super);
function Agent() {
_super.apply(this, arguments);
}
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function send
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Agent.prototype.send = function (resolve, reject) {
var _this = this;
var parsedUrl = url.parse(this.url);
var options = {
host: parsedUrl.host,
Function send
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send(resolve?: IsoHttp.ResolveCallback, reject?: IsoHttp.RejectCallback) {
var parsedUrl = url.parse(this.url);
var options: any = {
host: parsedUrl.host,
hostname: parsedUrl.hostname,
Function send
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Agent.prototype.send = function (resolve, reject) {
var _this = this;
var url = (this.method === 'GET')
? Helpers.joinUrlWithQuery(this.url, this.data)
: this.url;
Function send
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send(resolve?: IsoHttp.ResolveCallback, reject?: IsoHttp.RejectCallback) {
var url = (this.method === 'GET')
? Helpers.joinUrlWithQuery(this.url, this.data)
: this.url;
var xhr = this.createXhr();
Function send
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
send(resolve?: IsoHttp.ResolveCallback, reject?: IsoHttp.RejectCallback) {
var url = (this.method === 'GET')
? Helpers.joinUrlWithQuery(this.url, this.data)
: this.url;
var xhr = this.createXhr();
- Read upRead up
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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
constructor(options: RequestOptions) {
if (!options || !Object.keys(options).length) {
throw new Error('Missing options.');
}
if (!options.url) {
- Read upRead up
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"