Showing 14 of 20 total issues
Method set_initial_variables
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def set_initial_variables
github = Octokit::Client.new access_token: current_user.oauth_token
#Get the author that belongs to the user if there is one
current_author = Author.find_by(username: current_user.email)
- 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 filter_org_repos_between
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def filter_org_repos_between(repos, start_date, end_date)
#Filter local repos
repos_stored = Array.new
repos_after_start_date = Array.new
if (!start_date.nil? && !end_date.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 perform
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def perform()
user = User.find(user_id)
selfRepo = Repository.find(repo_id)
github = Octokit::Client.new access_token: user.oauth_token
remote_repo = github.repo selfRepo.full_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"
Further reading
Method show
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
@data_in_series = []
if params[:from_date].present? && params[:until_date].present?
@from_date = params[:from_date]
@until_date = params[:until_date]
Method perform
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform()
user = User.find(user_id)
selfRepo = Repository.find(repo_id)
github = Octokit::Client.new access_token: user.oauth_token
remote_repo = github.repo selfRepo.full_name
Method get_repos_from_orgs
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_repos_from_orgs(org_name)
org_repos_stored = Array.new
org_repos_not_stored = Array.new
org_repos = Array.new
- 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 update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update
respond_to do |format|
#if @repository.update(repository_params)
# format.html { redirect_to @repository, notice: 'Repository was successfully updated.' }
# format.json { render :show, status: :ok, location: @repository }
- 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 create
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
github = Octokit::Client.new access_token: current_user.oauth_token
#if not exist an 'user organization' on db
username = github.login
Method set_initial_variables
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_initial_variables
github = Octokit::Client.new access_token: current_user.oauth_token
#Get the author that belongs to the user if there is one
current_author = Author.find_by(username: current_user.email)
Method get_repos_from_orgs
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_repos_from_orgs(org_name)
org_repos_stored = Array.new
org_repos_not_stored = Array.new
org_repos = Array.new
Method update
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
respond_to do |format|
#if @repository.update(repository_params)
# format.html { redirect_to @repository, notice: 'Repository was successfully updated.' }
# format.json { render :show, status: :ok, location: @repository }
Method filter_org_repos_between
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filter_org_repos_between(repos, start_date, end_date)
#Filter local repos
repos_stored = Array.new
repos_after_start_date = Array.new
if (!start_date.nil? && !end_date.nil?)
Method store_orgs_needed
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def store_orgs_needed
github = Octokit::Client.new access_token: current_user.oauth_token
current_user_temp = current_user
#if not exist an 'user organization' on db save it
Method create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create
github = Octokit::Client.new access_token: current_user.oauth_token
#if not exist an 'user organization' on db
username = github.login
- 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"