Showing 2,737 of 2,737 total issues
Function DebContentViewsController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function DebContentViewsController($scope, Nutupane, ContentViewVersion, CurrentOrganization, translate) {
Function ContentCredentialProductsController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function ContentCredentialProductsController($scope, Nutupane, ContentCredential, ApiErrorHandler, translate) {
Function FilesController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function FilesController($scope, Nutupane, File, CurrentOrganization, translate) {
Function FileRepositoriesController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function FileRepositoriesController($scope, Nutupane, Repository, CurrentOrganization, translate) {
Function ContentCredentialACSController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function ContentCredentialACSController($scope, Nutupane, ContentCredential, ApiErrorHandler, translate) {
Function ContentCredentialRepositoriesController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function ContentCredentialRepositoriesController($scope, Nutupane, ContentCredential, ApiErrorHandler, translate) {
Function FileContentViewsController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function FileContentViewsController($scope, Nutupane, ContentViewVersion, CurrentOrganization, translate) {
Function DebRepositoriesController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function DebRepositoriesController($scope, Nutupane, Repository, CurrentOrganization, translate) {
Method update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(url, client_cert, client_key, ca_file, attributes)
Method plan_copy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plan_copy(action_class, source_repo, target_repo, clauses = nil, override_config = nil)
Method repos_to_sync
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def repos_to_sync(smart_proxy, environment, content_view, repository, skip_metatadata_check = false)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(url, crawled = [], found = [], to_follow = [],
upstream_credentials_and_search = {
upstream_username: nil,
upstream_password: nil,
search: '*'
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(url, crawled = [], found = [], to_follow = [],
upstream_credentials_and_search = {
upstream_username: nil,
upstream_password: nil
})
Method validate_length
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.validate_length(record, attribute, value, max_length = 128, min_length = 1)
Method plan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plan(url, content_type, upstream_username, upstream_password, search)
Method plan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plan(version, environments, is_force = false, description = nil, incremental_update = false)
Method metadata_generate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def metadata_generate(source_repositories, new_repository, filters, rpm_filenames, matching_content)
Method plan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plan(host, service_level, purpose_role, purpose_usage, purpose_addons)
Similar blocks of code found in 2 locations. Consider refactoring. Open
def with_identifiers(ids)
ids = [ids] unless ids.is_a?(Array)
ids.map!(&:to_s)
id_integers = ids.map { |string| Integer(string) rescue -1 }
where("#{self.table_name}.id in (?) or #{self.table_name}.pulp_id in (?)", id_integers, ids)
- 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 36.
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
def with_identifiers(ids)
ids = [ids] unless ids.is_a?(Array)
ids.map!(&:to_s)
id_integers = ids.map { |string| Integer(string) rescue -1 }
where("#{self.table_name}.id = (?) or #{self.table_name}.cp_id = (?)", id_integers, ids)
- 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 36.
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