Showing 26 of 33 total issues
Method pull
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@Option(names = {"--apiKey"}, description = "Project API Key") String apiKey,
@Option(names = {"--pullPath"}, description = "Directory where translations should be saved") String pullPath,
@Option(names = {"--environment"}, description = "Translation Hosting environment ('latest' or 'production')") String environment,
@Option(names = {"--filterRegex"}, description = "(Optional) Filter which resources should be downloaded") String filterRegex,
@Option(names = {"--baseUrl"}, description = "(Optional) Set custom server URL") String baseUrl
Method invoke
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void invoke() throws IOException, InterruptedException
{
String responseData = client.fetchProject();
DocumentContext json = jsonReader.read(responseData);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method isMultiLanguage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private boolean isMultiLanguage(Configuration configuration)
{
List<String> multiLanguageFileFormats = List.of("multi-language-json", "excel", "csv-translations");
for (String uploadFormat : multiLanguageFileFormats)
{
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method trySendException
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void trySendException(Exception exception)
{
try
{
SimpleLocalizeClient client = SimpleLocalizeClient.create(effectiveCommandConfiguration.getBaseUrl(), effectiveCommandConfiguration.getApiKey());
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method createHttpClient
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static HttpClient createHttpClient()
{
HttpClient.Builder builder = HttpClient
.newBuilder()
.connectTimeout(Duration.ofMinutes(5));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method pull
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Command(
name = "pull",
description = "Pull translations from Translation Hosting Use 'simplelocalize pull --help' to learn more about the parameters.")
public void pull(
@Option(names = {"--apiKey"}, description = "Project API Key") String apiKey,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"