Showing 2,737 of 2,737 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
{
id: 3,
name: 'test',
label: 'test',
publish_date: '4 days',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const Table = ({
emptyState,
tableColumns,
subscriptions,
loadSubscriptions,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function search_field_scale
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.search_field_scale = function() {
var dd_top, div, h, style, style_block, styles, w, _i, _len;
if (this.is_multiple) {
h = 0;
w = 0;
Function CanvasRenderingContext2D_
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CanvasRenderingContext2D_(canvasElement) {
this.m_ = createMatrixIdentity();
this.mStack_ = [];
this.aStack_ = [];
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div style={{ display: 'flex' }}>
<DropdownButton title={this.state.searchList.title} id="search-list-select">
{this.dropDownItems
Function DiscoveryRepositories
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DiscoveryRepositories() {
this.rows = [];
this.repositoryUrl = '';
this.upstreamUsername = '';
this.upstreamPassword = '';
Method safe_render_container_name
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.safe_render_container_name(repository, pattern = nil)
# pattern provided / env pattern provided
# | 00 | 01 | 11 | 10
# ----------------+-----+-----+-----+------
# env exists / 00| 4 | n/a | n/a | 4
Method run_event
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_event(event)
Katello::Logging.time("katello event handled") do |data|
data[:type] = event.event_type
data[:object_id] = event.object_id
data[:expired] = false
Method import_uploads
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_uploads
generate_metadata = ::Foreman::Cast.to_bool(params.fetch(:publish_repository, true))
sync_capsule = ::Foreman::Cast.to_bool(params.fetch(:sync_capsule, true))
async = ::Foreman::Cast.to_bool(params.fetch(:async, false))
if params['uploads'].empty?
Method components_repo_instances
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def components_repo_instances(old_version_repo, new_component_versions)
# Attempt to locate the repo instance in the new component versions
new_repos = nil
new_component_versions.map do |cvv|
cvv.repositories.each do |component_repo|
Method filtered_pools
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filtered_pools(match_attached, match_host, match_installed, no_overlap)
if match_host
pools = self.available_pools
elsif match_attached
pools = self.entitlements.map { |ent| ent['pool'] }
Method finalize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def finalize # rubocop:disable Metrics/AbcSize
content_view = ::Katello::ContentView.find(input[:content_view_id])
environment = ::Katello::KTEnvironment.find(input[:environment_id])
content_ids = content_view.repos(environment).map(&:content_id).uniq.compact
# in case we create new custom repository that doesn't have the
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
return if input[:tasks].empty?
version_hrefs = input[:tasks].last[:created_resources]
repositories = find_repositories(input[:repository_ids])
Method activation_keys_permissions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def activation_keys_permissions
@plugin.permission :view_activation_keys,
{
'katello/activation_keys' => [:all, :index],
'katello/api/v2/activation_keys' => [:index, :show, :available_host_collections, :available_releases,
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
repo = ::Katello::Repository.find(input[:repository_id])
if input[:force_fetch_version]
version_href = fetch_version_href(repo)
elsif input[:repository_details].present?
Method plan
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plan(repository, options = {})
affected_cvv_ids = []
skip_environment_update = options.fetch(:skip_environment_update, false) ||
options.fetch(:organization_destroy, false)
destroy_content = options.fetch(:destroy_content, true)
Similar blocks of code found in 4 locations. Consider refactoring. Open
<DualListSelector
isSearchable
availableOptions={availableOptions}
chosenOptions={productNames}
addAll={onListChange}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
<DropdownItem
aria-label="bulk_remove"
ouiaId="bulk_remove"
key="bulk_remove"
component="button"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
<DropdownItem
aria-label="bulk_remove"
ouiaId="bulk_remove"
key="bulk_remove"
component="button"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
<DualListSelector
isSearchable
availableOptions={availableOptions}
chosenOptions={acsSmartProxies}
addAll={onListChange}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76