Showing 3,994 of 4,023 total issues
Similar blocks of code found in 2 locations. 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.
*
- 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 63.
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
@Test
public void buildCipherSuites_CipherSuiteIsMicroFocusAccepted_ValidResult() throws Exception {
final String cipherSuite = CipherSuites.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 + ", \n\t" +
CipherSuites.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256;
- 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 63.
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
public enum MarkingType {
SIMPLE_TEXT("simpleText"),
UNDERLINED_TEXT("underlinedText"),
TEXT_IN_FRAME("textInFrame"),
GREY_BOXES("greyBoxes"),
- 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 63.
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
@Test
public void buildTlsVersions_TlsVersionIsValid_ValidResult() throws Exception {
final String tlsVersion = TlsVersions.SSLv3 + ", \n\t" + TlsVersions.TLSv1_2;
List<String> result = InputBuilderUtils.buildTlsVersions(tlsVersion);
- 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 63.
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
@Test
public void testExecuteAllValid() {
result = parseDate
.execute("2001-07-04T12:08:56.235+0700", "yyyy-MM-dd'T'HH:mm:ss.SSSZ", "en", "US", "yyyy-MM-dd", "fr", "FR");
assertEquals(SUCCESS, result.get(RETURN_CODE));
- 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 63.
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
Method setSecurityInputs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static void setSecurityInputs(@NotNull final HttpClientInputs httpClientInputs,
@NotNull final String trustAllRoots,
@NotNull final String x509HostnameVerifier,
@NotNull final String keystore,
@NotNull final String keystorePassword,
Method setConnectionParameters
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static void setConnectionParameters(HttpClientInputs httpClientInputs,
@NotNull final String connectTimeout,
@NotNull final String socketTimeout,
@NotNull final String keepAlive,
@NotNull final String connectionsMaxPerRoot,
Method verifySqlQuery
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifySqlQuery(@NotNull final String walletPath,
@NotNull final String trustore,
@NotNull final String keystore,
@NotNull final String overwrite,
@NotNull final String timeout,
Method parseDate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String parseDate(final String date, final String dateFormat, final String dateLocaleLang,
final String dateLocaleCountry, final String outFormat, final String outLocaleLang,
final String outLocaleCountry) throws Exception {
Method execute
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public Map<String, String> execute(@Param(value = LOCALE_DATE, required = true) String date,
@Param(value = DATE_FORMAT) String dateFormat,
@Param(value = DATE_LOCALE_LANG) String dateLocaleLang,
@Param(value = DATE_LOCALE_COUNTRY) String dateLocaleCountry,
@Param(value = OUT_FORMAT) String outFormat,
Method getValidKeyOrValueTag
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String getValidKeyOrValueTag(String input, String pattern, boolean isKey, boolean condition,
boolean patternCheck, int keyMaxLength, int valueMaxLength) {
Method parseResponse
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public Map<String, String> parseResponse(CloseableHttpResponse httpResponse,
String responseCharacterSet,
String destinationFile,
URI uri,
HttpClientContext httpClientContext,
Method processIndex
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<Integer> processIndex(final String index, final Sheet worksheet, final String rowData, final String rowDelimiter,
final String columnDelimiter, final boolean isRow, final boolean hasHeader) {
Method execute
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public Map<String, String> execute(@Param(value = EXCEL_FILE_NAME, required = true, description = EXCEL_FILE_NAME_DESC) String excelFileName,
@Param(value = WORKSHEET_NAME, description = WORKSHEET_NAME_DESC) String worksheetName,
@Param(value = HAS_HEADER, description = HAS_HEADER_DESC) String hasHeader,
@Param(value = FIRST_ROW_INDEX, description = FIRST_ROW_INDEX_DESC) String firstRowIndex,
@Param(value = COLUMN_INDEX_TO_QUERY, required = true, description = COLUMN_INDEX_TO_QUERY_DESC) String columnIndextoQuery,
Method getCellFromWorksheet
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private static String getCellFromWorksheet(final Workbook excelDoc,
final Sheet worksheet,
final List<Integer> columnIndex,
final List<Integer> rowIndex,
final String rowDelimiter,
Method verifyCommonInputs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyCommonInputs(@Nullable final String proxyPort,
@Nullable final String trust_all_roots,
@Nullable final String connectTimeout,
@Nullable final String socketTimeout,
@Nullable final String keepAlive,
Method getInstanceStatus
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String getInstanceStatus(final String proxyHost,
final String proxyPort,
final String proxyUsername,
final String proxyPassword,
final String instanceId,
Method getDataDiskList
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<CreateInstanceRequest.DataDisk> getDataDiskList(@NotNull final List<String> dataDisksSizeListImp,
@NotNull final List<String> dataDisksCategoryListImp,
@NotNull final List<String> dataDisksSnapshotIdListImp,
@NotNull final List<String> dataDisksNameListImp,
@NotNull final List<String> dataDisksDescriptionListImp,
Method restartInstance
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String restartInstance(final String proxyHost,
final String proxyPort,
final String proxyUsername,
final String proxyPassword,
final String instanceId,
Method startInstance
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String startInstance(final String proxyHost,
final String proxyPort,
final String proxyUsername,
final String proxyPassword,
final String instanceId,