simplelocalize/simplelocalize-cli

View on GitHub

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
Severity: Minor
Found in src/main/java/io/simplelocalize/cli/SimplelocalizeCliCommand.java - About 35 mins to fix

    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);
    
    
    Severity: Minor
    Found in src/main/java/io/simplelocalize/cli/command/PullHostingCommand.java - About 35 mins to fix

    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)
        {
    Severity: Minor
    Found in src/main/java/io/simplelocalize/cli/command/UploadCommand.java - About 25 mins to fix

    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());
    Severity: Minor
    Found in src/main/java/io/simplelocalize/cli/SimplelocalizeCliCommand.java - About 25 mins to fix

    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));
    Severity: Minor
    Found in src/main/java/io/simplelocalize/cli/client/HttpClientFactory.java - About 25 mins to fix

    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,
    Severity: Minor
    Found in src/main/java/io/simplelocalize/cli/SimplelocalizeCliCommand.java - About 25 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language