Showing 73 of 116 total issues
File marked.js
has 901 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* marked - a markdown parser
* Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
* https://github.com/chjj/marked
*/
Function token
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
Lexer.prototype.token = function(src, top, bq) {
var src = src.replace(/^ +$/gm, '')
, next
, loose
, cap
Function handleLogin
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleLogin() {
var scopes = [];
var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
if(auths) {
Class Stub
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Stub < BaseAdapter
# Error message saying that the adapter feature has not been implemented yet.
NOT_IMPLEMENTED_ERROR = Errors::AdapterMissingImplementationError.new(
'Adapter is missing an implementation to support this feature'
)
Function handleLogin
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function handleLogin() {
var scopes = [];
var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
if(auths) {
- 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 output
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
InlineLexer.prototype.output = function(src) {
var out = ''
, link
, text
, href
Function tok
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Parser.prototype.tok = function() {
switch (this.token.type) {
case 'space': {
return '';
}
Method update_fields
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def update_fields(entity, entity_documentation, fields)
# update all fields, but only with allowed values (according to the doc)
unless fields.nil?
fields.each do |key, value|
# only continue if the value can be assigned to the entity
- 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
File swagger-oauth.js
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
var appName;
var popupMask;
var popupDialog;
var clientId;
var realm;
Function marked
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function marked(src, opt, callback) {
if (callback || typeof opt === 'function') {
if (!callback) {
callback = opt;
opt = null;
Method un_zip
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def un_zip(file, destination_path)
extracted = 0
Zip::File.open(file) do |zip_file|
# Handle entries one by one
zip_file.each do |entry|
- 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
Class CloudFoundryV2
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class CloudFoundryV2 < Stub
# Cloud Foundry, operations for the application's addons
module Services
# @see Stub#services
def services
Function onOAuthComplete
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) {
if(token) {
if(token.error) {
var checkbox = $('input[type=checkbox],.secured')
checkbox.each(function(pos){
Method deploy
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def deploy(file, file_compression_format)
extractor = Nucleus::ArchiveExtractor.new
unless extractor.supports? file_compression_format
raise Errors::AdapterRequestError,
'Unsupported format of the application archive'
- 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 un_tar_gz
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def un_tar_gz(file, destination_path)
extracted = 0
# unzip the archive into the repo, closes resource automatically
# Thanks to Draco Ater: http://stackoverflow.com/a/19139114/1009436
Gem::Package::TarReader.new(Zlib::GzipReader.open(file)) do |tar|
- 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 save_file_from_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.save_file_from_data(file, io, force = true, expected_file_md5_hex = nil)
if File.exist? file
unless force
# fail if file exists, but shall not be replaced
raise Nucleus::FileExistenceError, 'File already exists' if expected_file_md5_hex.nil?
- 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 state_created?
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def state_created?(app, gear_groups, deployments)
# this state exists, but only within the first seconds before the original deployment is applied
return true if gear_groups[0][:gears].all? { |gear| gear[:state] == 'new' }
if app[:keep_deployments].to_i > 1
- 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 onOAuthComplete
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) {
if(token) {
if(token.error) {
var checkbox = $('input[type=checkbox],.secured')
checkbox.each(function(pos){
- 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 set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set(entity)
update_timestamps(entity)
# finally save to the DB
if entity.id.nil?
- 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 application_state
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def application_state(app, retrieved_dynos = nil)
# 1: created, both repo and slug are nil
return Enums::ApplicationStates::CREATED unless repo_or_slug_content?(app)
# all subsequent states require dynos to be determined
- 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"