Showing 23 of 31 total issues
Class Project
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Project < ActiveRecord::Base
RECENT_STATUS_COUNT = 8
DEFAULT_POLLING_INTERVAL = 30
MAX_STATUS = 15
Function validateTrackerSetup
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
o.validateTrackerSetup = function () {
var authToken = $('input#project_tracker_auth_token').val();
var projectId = $('input#project_tracker_project_id').val();
clearTrackerSetupValidations();
Function Refresher
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Refresher = (function (options) {
for (var key in options) {
if (options.hasOwnProperty(key)) {
this[key] = options[key];
}
Method update
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def update
if params[:password_changed] != 'true'
params[:project].delete(:auth_password)
else
params[:project][:auth_password] = nil unless params[:project][:auth_password].present?
- 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 RubyGemsRefresh
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
var RubyGemsRefresh = (function () {
var refresher;
var failureThreshold = 4, failureCount = 0;
return {
- 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 GithubRefresh
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var GithubRefresh = (function () {
var refresher;
var failureThreshold = 4, failureCount = 0;
return {
- 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 HerokuRefresh
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var HerokuRefresh = (function () {
var refresher;
var failureThreshold = 4, failureCount = 0;
return {
- 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 validateFeedUrl
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
o.validateFeedUrl = function () {
$('.success, .failure, .unconfigured, .empty_fields', '#polling').addClass('hide');
if ($('#project_type').val() === "") {
$('#build_status .unconfigured').removeClass('hide');
Function RubyGemsRefresh
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RubyGemsRefresh = (function () {
var refresher;
var failureThreshold = 4, failureCount = 0;
return {
Function HerokuRefresh
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var HerokuRefresh = (function () {
var refresher;
var failureThreshold = 4, failureCount = 0;
return {
Function ProjectCheck
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ProjectCheck = function() {
var projectCheckTimeout = 30 * 1000;
var currentTimeout;
Function humanReadableErrorHTML
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var humanReadableErrorHTML = function(error) {
var string = "";
var error_text = error.error_text;
var project_type = $("#project_type").val();
var url = "";
Function GithubRefresh
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var GithubRefresh = (function () {
var refresher;
var failureThreshold = 4, failureCount = 0;
return {
Function VersionCheck
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var VersionCheck = function() {
var versionCheckTimeout = 30 * 1000;
var currentTimeout;
Method static_status_messages_for
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def static_status_messages_for(project)
messages = []
if project.online?
messages << (project.status.published_at.present? ? "Last built #{project.status.published_at}": 'Last build date unknown')
if project.failure?
- 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 autocomplete
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function autocomplete(selector, item_list) {
$(function() {
function split( val ) {
return val.split( /,\s*/ );
}
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(stdin, stdout, org, space, env, cf_authenticator = CF_authenticator.new(), cf_git_tagger = CF_git_tagger.new())
Method import
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def import(config)
config = YAML.load(config)
Project.transaction do
cached_agg = {}
- 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 convert_xml_content!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def convert_xml_content!(raw_content, preserve_case = false)
raw_content = raw_content.downcase unless preserve_case
parsed_xml = Nokogiri::XML.parse(raw_content)
raise Payload::InvalidContentException, "Error converting content for project #{@project_name}" unless parsed_xml.root
parsed_xml
- 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 fetch_status
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fetch_status(project, url)
@concourse_authenticator.authenticate(project.auth_url, project.auth_username, project.auth_password) do |auth_poll_state, auth_status_code, auth_response|
if auth_poll_state != PollState::SUCCEEDED
yield auth_poll_state, auth_response, auth_status_code
else
- 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"