Showing 45 of 138 total issues
Method check_tools
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_tools(tool)
case tool.name
when 'amass'
value = tool.infos['config_value']
return 'amass_invalid' unless base64?(value)
Method index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def index
@subdomains = if params[:domain]
domain = Domain.find_by_name(params[:domain])
domain.nil? ? [] : domain.subdomains
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 parse_payouts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_payouts(payouts, from, to)
payouts_data = {}
payouts.each do |payout|
next unless payout['createdAt'] > from && payout['createdAt'] < to
- 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 build_scan_cmd
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_scan_cmd(scan)
scan_cmd = { cmd: 'ruby /tmp/tools/scan.rb' }
hunt3r_token = Tool.find_by(name: 'hunt3r_token')&.infos
scan_cmd[:errors] = 'hunt3r_token' if hunt3r_token.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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
platform = Platform.find_by_name(params[:name])
unless allowed_platform?(platform)
return render status: 422, json: { message: I18n.t('errors.controllers.admin.invoices.unsupported_platform') }
end
- 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 parse_scopes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_scopes(scopes, slug, platform)
program = Program.find_by(slug: slug)
scopes.each do |scope|
type = scope['type']
next unless type == 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
Method ssh_key_valid?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ssh_key_valid?(provider)
return false unless provider.infos['ssh_key']
path = "/root/.ssh/#{provider.name}_id_rsa"
dir = File.dirname(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 parse_scopes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_scopes(scopes, slug, platform)
program = Program.find_by(slug: slug)
scopes.each do |scope|
type = scope['scope_type']
next unless %w[web-application api].include?(type)
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate
platform = Platform.find_by_name(params[:name])
unless allowed_platform?(platform)
return render status: 422, json: { message: I18n.t('errors.controllers.admin.invoices.unsupported_platform') }
end
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create
scan_infos = params.require(:scan).permit(
:domain, :meshs, :type_scan, :instance_type, :provider, :notifs, :active_recon, :intel, :leak, :nuclei,
:all_templates, :custom_interactsh, :permutation, :gau, excludes: [], nuclei_severity: [], custom_templates: []
)
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create
return error_insufficient_params unless params[:email].present? && params[:password].present?
@user = User.find_by(email: params[:email])
return error_invalid_credentials unless @user&.authenticate(params[:password])
- 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 initBarreData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
initBarreData(stat:any){
let month=(new Date()).getMonth();
let year=((new Date()).getFullYear()-2);
let data=Array()
let data2=Array()
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create
template_data = params.require(:template).permit(:name, :value)
value = template_data[:value]
unless base64?(value) && yaml?(value)
- 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 countSeverity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
countSeverity(severity:string,rapport_severity:any,plateform:'YWH'|'INTI'|'H1'){
if(severity!=null) severity=severity[0].toUpperCase() + severity.substr(1).toLowerCase()
if(severity=="Low")rapport_severity.L++
if(severity=="Medium")rapport_severity.M++
if(severity=="High")rapport_severity.H++
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def update
return render status: 422, json: { message: I18n.t('errors.controllers.admin.providers.unknown'), data: nil } if @provider.nil?
providers_params = get_provider_params
- 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_jwt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.get_jwt(platform)
return unless platform.jwt.nil? || (Time.now - platform.updated_at) > 3500
totp_token = get_totp_token(platform)
return unless totp_token
- 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 index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index
@leaks = if params[:domain] && !params[:domain].empty?
Domain.find_by(name: params[:domain])&.leaks
else
Leak.all
- 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 current_user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def current_user
return @current_user if @current_user
@current_user = nil
return unless decoded_token
- 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_report_reward
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_report_reward(platform, report_id)
response = api_request(platform, "https://api.hackerone.com/v1/hackers/reports/#{report_id}")
return unless response.code == 200
report_activities = JSON.parse(response.body)['data']['relationships']['activities']['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
Method create_outside
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_outside
leaks_params = params.require(:leaks).permit(:token, :domain, leaks: %i[username email password])
unless hunt3r_token_valid?(leaks_params[:token])
return render status: 422, json: { message: I18n.t('errors.controllers.leaks.invalid'), data: 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"