Showing 12 of 245 total issues
File fetch.js
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function() {
'use strict';
if (self.fetch) {
return
Function build_hierarchy
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function build_hierarchy(top, node) {
var hierarchy = document.createElement('div');
hierarchy.className = 'hierarchy';
top.insertBefore(hierarchy, top.firstChild);
fetch('/v1/' + base + '/node/' + node + '/hierarchy', auth_header()).
File nodes.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
We don't need jQuery fat mama
http://youmightnotneedjquery.com/
https://github.com/oneuijs/You-Dont-Need-jQuery
Function Body
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Body() {
this.bodyUsed = false
this._initBody = function(body) {
Function fetch
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request
if (Request.prototype.isPrototypeOf(input) && !init) {
request = input
Method cross_origin
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def cross_origin(hash=nil)
request_origin = request.env['HTTP_ORIGIN']
return unless request_origin
settings.set hash if hash
- 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
Method check_authorization
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def check_authorization
if session_info['username']
session_info['username']
else
access_token = session['access_token']
- 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
Method check_authorization
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check_authorization
if !session['access_token'] && !request.env['HTTP_X_AUTH']
redirect '/v1/not_logged'
else
token = session['access_token'] || request.env['HTTP_X_AUTH']
- 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 Request
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Request(input, options) {
options = options || {}
var body = options.body
if (Request.prototype.isPrototypeOf(input)) {
if (input.bodyUsed) {
Method cross_origin
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cross_origin(hash=nil)
request_origin = request.env['HTTP_ORIGIN']
return unless request_origin
settings.set hash if hash
Function build_line
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function build_line(top, file, key, value, overriden) {
Method get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get(key, expiration)
file = tmpfile(key)
if File.exist?(file)
if expiration && expired?(file, expiration)
File.unlink(file)
- 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"