Showing 2,737 of 2,737 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
subscriptions: PropTypes.shape({
searchIsActive: PropTypes.bool,
itemCount: PropTypes.number,
pagination: PropTypes.shape({}),
// Disabling rule as existing code failed due to an eslint-plugin-react update
- 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 62.
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
repositorySets: PropTypes.shape({
recommended: PropTypes.bool,
loading: PropTypes.bool,
search: PropTypes.shape({}),
// Disabling rule as existing code failed due to an eslint-plugin-react update
- 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 62.
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 katelloPackageUpdateParams = ({ hostname, packageName, descriptionFormat }) =>
baseParams({
hostname,
inputs: { package: packageName },
feature: REX_FEATURES.KATELLO_PACKAGE_UPDATE,
- 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 62.
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
useDeepCompareEffect(
() => {
if (selectedEnvForAK.length) {
dispatch(getContentViews({
environment_id: first(selectedEnvForAK).id,
- 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 62.
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 scopeContentTypes = testConfigViewByDifferent.map(({ dataUrl, data }) =>
nockInstance.persist().get(dataUrl).query(true).reply(200, data));
- 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 62.
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
Consider simplifying this complex logical expression. Open
if source_repo.content_type == ::Katello::Repository::YUM_TYPE
srpms_match = srpms_match?(source_repo, target_repo)
rpms = rpms_match?(source_repo, target_repo)
errata = errata_match?(source_repo, target_repo)
package_groups = package_groups_match?(source_repo, target_repo)
Function wrapper
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
wrapper: (hostDetails) => {
const contentViewEnvironments =
hostDetails?.content_facet_attributes?.content_view_environments ?? [];
if (contentViewEnvironments.length === 0) return '—'; // don't show popover
return (
Function results_build
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.results_build = function() {
var content, data, startTime, _i, _len, _ref;
startTime = new Date();
this.parsing = true;
this.results_data = root.SelectParser.select_to_array(this.form_field);
Function keyup_checker
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
AbstractChosen.prototype.keyup_checker = function(evt) {
var stroke, _ref;
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
this.search_field_scale();
switch (stroke) {
Function buildRows
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const buildRows = useCallback((results) => {
const isAddedToFilter = repoId => (!!repositories.filter(repo => repo.id === repoId).length);
const newRows = [];
results.forEach((repo) => {
const {
Function buildRows
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const buildRows = useCallback((results) => {
const newRows = [];
const filterRules = filterResults.find(({ id }) => id === Number(filterId))?.rules || [];
results.forEach((moduleStreams) => {
const {
Function controller
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', 'translate', function ($scope, translate) {
$scope.newBookmark = {};
$scope.load = function () {
BstBookmark.queryPaged({search: 'controller=' + $scope.controllerName}, function (response) {
Method sync_available_module_stream_associations
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sync_available_module_stream_associations(new_available_module_streams)
new_associated_ids = new_available_module_streams.keys.compact
upgradable_streams = self.host_available_module_streams.where(:available_module_stream_id => new_associated_ids)
old_associated_ids = self.available_module_stream_ids
delete_ids = old_associated_ids - new_associated_ids
Method index
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
unless @organization || @activation_key
fail HttpErrors::NotFound, _("Organization Information not provided.")
end
Method generate!
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate!
# For Red Hat repositories or Custom Repositories in the metadata exclusively
# Set up a 2 different list of importable root repositories
# creatable: repos that are part of the metadata but not in the library.
# They are ready to be created
Method destroy_repositories
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def destroy_repositories
deletion_authorized_repositories = @repositories.deletable
unpromoted_repos = Setting[:delete_repo_across_cv] ? deletion_authorized_repositories : deletion_authorized_repositories.reject { |repo| repo.promoted? && repo.content_views.generated_for_none.exists? }
unpromoted_repos_non_last_affected_repo = unpromoted_repos.reject { |repo| repo.filters.any? { |filter| filter.repositories.size == 1 } }
messages1 = format_bulk_action_messages(
Method plan
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plan(repository, smart_proxy, args)
file = {:filename => args.dig(:unit_key, :name), :sha256 => args.dig(:unit_key, :checksum) }
content_unit_href = args.dig(:unit_key, :content_unit_id)
docker_tag = (args.dig(:unit_type_id) == "docker_tag")
Method run
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run # rubocop:disable Metrics/AbcSize
smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
api = ::Katello::Pulp3::Api::Core.new(smart_proxy)
export_data = api.export_api.list(input[:exporter_data][:pulp_href]).results.first
output[:exported_file_checksum] = export_data.output_file_info
Similar blocks of code found in 9 locations. Consider refactoring. Open
this.openHostCollectionsModal = function() {
$uibModal.open({
templateUrl: 'content-hosts/bulk/views/content-hosts-bulk-host-collections-modal.html',
controller: 'ContentHostsBulkHostCollectionsModalController',
size: 'lg',
- 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 61.
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 9 locations. Consider refactoring. Open
this.openPackagesModal = function() {
$uibModal.open({
templateUrl: 'content-hosts/bulk/views/content-hosts-bulk-packages-modal.html',
controller: 'ContentHostsBulkPackagesModalController',
size: 'lg',
- 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 61.
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