Method post_results
has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring. Open
def post_results(compiler, pending)
@dateprefix = DateTime.now.utc.strftime('%F') if @dateprefix.nil?
test_results_data = []
- 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 potentialbuild.rb
has 798 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'octokit'
require 'json'
require 'open3'
require 'pathname'
require 'active_support/core_ext/hash'
Method post_results
has 334 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_results(compiler, pending)
@dateprefix = DateTime.now.utc.strftime('%F') if @dateprefix.nil?
test_results_data = []
Method parse_callgrind
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def parse_callgrind(build_dir, file)
object_files = {}
source_files = {}
functions = {}
props = {}
- 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 PotentialBuild
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class PotentialBuild
include CMake
include Configuration
include ResultsProcessor
include Lcov
Method parse_callgrind
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_callgrind(build_dir, file)
object_files = {}
source_files = {}
functions = {}
props = {}
Method initialize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(client, token, repository, tag_name, commit_sha, branch_name, author, release_url, release_assets, # rubocop:disable Metrics/ParameterLists
pull_id, pr_base_repository, pr_base_ref)
@client = client
@config = load_configuration(repository, (tag_name.nil? ? commit_sha : tag_name), !release_url.nil?)
@config.repository_name = github_query(@client) { @client.repo(repository).name }
Method initialize
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(client, token, repository, tag_name, commit_sha, branch_name, author, release_url, release_assets, # rubocop:disable Metrics/ParameterLists
pull_id, pr_base_repository, pr_base_ref)
Method try_to_repost_asset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Wontfix
def try_to_repost_asset(response, asset_name)
asset_url = nil
if !response.nil? && response.state == 'new'
$logger.error("Error uploading asset #{response.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"
Further reading
Method get_short_form
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_short_form(str)
return nil if str.nil?
if str.length <= 10 && str =~ /[a-zA-Z]/
str
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, token, repository, tag_name, commit_sha, branch_name, author, release_url, release_assets, # rubocop:disable Metrics/ParameterLists
pull_id, pr_base_repository, pr_base_ref)
@client = client
@config = load_configuration(repository, (tag_name.nil? ? commit_sha : tag_name), !release_url.nil?)
@config.repository_name = github_query(@client) { @client.repo(repository).name }
- 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"