File InputsValidation.java
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2021-2024 Open Text
* This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
InputsValidation
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
public class InputsValidation {
@NotNull
public static List<String> verifyInputsFTP(
@Nullable final String hostName,
Method verifyRemoteCopyInputs
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String sourceHost,
@Nullable final String sourcePort,
@Nullable final String sourcePath,
@Nullable final String sourceProtocol,
@Nullable final String sourceCharacterSet,
Method verifySFTPDownloadFileInputs
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String host,
@Nullable final String port,
@Nullable final String username,
@Nullable final String password,
@Nullable final String proxyPort,
Method verifyInputsSFTPCommand
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyInputsSFTPCommand(String remotePath,
String newRemotePath,
String mode,
String host,
String port,
Method verifyGetChildrenInputsSFTP
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String host,
@Nullable final String port,
@Nullable final String username,
@Nullable final String password,
@Nullable final String proxyPort,
Method verifySFTPUploadFileInputs
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String host,
@Nullable final String port,
@Nullable final String username,
@Nullable final String password,
@Nullable final String proxyPort,
Method verifyInputsSFTPRename
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyInputsSFTPRename(String remotePath,
String newRemotePath,
String host,
String port,
String username,
Method verifyDeleteFileInputs
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyDeleteFileInputs(String remoteFile,
String remotePath,
String host,
String port,
String username,
Method verifyInputsSFTP
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyInputsSFTP(String remoteFile,
String remotePath,
String host,
String port,
String username,
Method verifyInputsFolders
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyInputsFolders(String remotePath,
String host,
String port,
String username,
String password,
Method verifyInputsFTP
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String hostName,
@Nullable final String port,
@Nullable final String localFile,
@Nullable final String remoteFile,
@Nullable final String user,
Method verifyCommonSFTPInputs
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String host,
@Nullable final String port,
@Nullable final String username,
@Nullable final String password,
@Nullable final String proxyPort,
Method verifySCPRemoteCopyFileInputs
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String sourceHost,
@Nullable final String sourcePort,
@Nullable final String sourcePath,
@Nullable final String destinationHost,
@Nullable final String destinationPort,
Method verifySCPCopyFileInputs
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
@Nullable final String host,
@Nullable final String port,
@Nullable final String localFile,
@Nullable final String copyAction,
@Nullable final String remoteFile,
Method addVerifyRemotePathAndFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static void addVerifyRemotePathAndFile(@NotNull List<String> exceptions, @Nullable final String remotePath, @Nullable final String remoteFile,
@NotNull final String remotePathInput, @NotNull final String remoteFileInput) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
@NotNull
private static List<String> addVerifyNumber(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) {
if (isEmpty(input)) {
exceptions.add(String.format(EXCEPTION_NULL_EMPTY, inputName));
} else if (!NumberUtilities.isValidInt(input)) {
- 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 90.
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 3 locations. Consider refactoring. Open
public static List<String> verifyInputsSFTPRename(String remotePath,
String newRemotePath,
String host,
String port,
String username,
- 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 68.
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 3 locations. Consider refactoring. Open
public static List<String> verifyGetChildrenInputsSFTP(
@Nullable final String host,
@Nullable final String port,
@Nullable final String username,
@Nullable final String password,
- 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 68.
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 3 locations. Consider refactoring. Open
public static List<String> verifyDeleteFileInputs(String remoteFile,
String remotePath,
String host,
String port,
String username,
- 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 68.
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