Showing 25 of 25 total issues
Class Project
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class Project < ActiveRecord::Base
include Sortable
after_create :set_path, :init, :add_tags
after_destroy :deletefiles
File projects_controller.rb
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ProjectsController < ApplicationController
before_filter :store_return_to
before_filter :return_context, except: [:new,
:create,
File project.rb
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Project < ActiveRecord::Base
include Sortable
after_create :set_path, :init, :add_tags
after_destroy :deletefiles
Class ProjectsController
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class ProjectsController < ApplicationController
before_filter :store_return_to
before_filter :return_context, except: [:new,
:create,
Method traverse
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def traverse
return [nil, [], []] if project.barerepo.empty?
images = []
directories = []
readme = 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 commit_touches_path?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def commit_touches_path?(commit, walker)
entry = tree_entry(commit)
num_treesame = 0
if commit.parents.empty?
- 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 nested_projects
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def nested_projects(roots, project)
content_tag :ul, class: 'nested_projects' do
roots.each do |root|
user_link = link_to(root.user.username, "/#{root.user.username}")
project_link = link_to(root.name, root.urlbase)
- 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 project_by_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def project_by_path(path)
if m = /^([\w\.\/-]+)\.git/.match(path).to_a
path_with_namespace = m.last
path_with_namespace[0] = '' if path_with_namespace.start_with?('/')
return nil unless path_with_namespace.include?('/')
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
@issue = Issue.new(issue_params)
@issue.user = current_user
@issue.project = @project
@issue.status = 0
- 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 generate_images_between
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_images_between(old_sha, new_sha, branch)
head = @sat_repo.lookup("#{new_sha}")
# tails won't exist if previously repo was empty
tail = @sat_repo.lookup("#{old_sha}") unless old_sha[0..5] == '000000'
walker = Rugged::Walker.new(@sat_repo)
- 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 authorized_request?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def authorized_request?
case git_cmd
when *%w( git-upload-pack git-upload-archive )
if user
ProjectMember.member?(project, user)
- 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_image
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_image(branch, old_path, new_file, author, message)
Method create_directory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_directory
if params[:directory].empty?
flash[:alert] = 'No name provided for the directory!'
redirect_to :back
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"
Further reading
Method find_file_types
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_file_types(project)
formats = { '.svg' => 0, '.jpg' => 0, '.png' => 0, 'other' => 0 }
path = File.join project.satellitedir, '/**/*'
files = Dir[path]
files.each do |f|
- 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 tree_entry
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tree_entry(commit)
pathname = Pathname.new(path)
tmp_entry = nil
pathname.each_filename do |dir|
- 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 file_upload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def file_upload
branch = params[:branch] || 'master'
if params[:file]
if user_signed_in? && @project.add_images(
branch,
- 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 breadcrumb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def breadcrumb
res = link_to(@project.name,
project_tree_path(@project, params[:oid], ''))
dest = ''
arr = params[:destination].split('/')
- 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 call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
@env = env
@request = Rack::Request.new(env)
@auth = Request.new(env)
- 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 find_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_files(query, project)
images = []
dir = []
path = File.join project.satellitedir, '/**/*'
files = Dir[path]
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
new_member = ProjectMember.new(
gallery_id: @project.id,
member_id: params[:member_id],
role: params[:role]
- 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"