CloudSlang/cs-actions

View on GitHub
cs-filesystem/src/main/java/io/cloudslang/content/filesystem/services/GetModifiedDateService.java

Summary

Maintainability
A
3 hrs
Test Coverage

Method parseDate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private static Date parseDate(String toParse) throws ParseException {
        Date decoded = null;
        try {
            decoded = parseDate(toParse, DateFormat.SHORT);
        } catch (ParseException a) {

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 parseDate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static Date parseDate(String toParse, int style, Locale locale) throws ParseException {
        Date d;
        try {
            DateFormat f = DateFormat.getDateTimeInstance(style, DateFormat.MEDIUM, locale);
            d = f.parse(toParse);

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 parseDate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static Date parseDate(String toParse, int style) throws ParseException {
        Date d;
        try {
            DateFormat f = DateFormat.getDateTimeInstance(style, DateFormat.MEDIUM);
            d = f.parse(toParse);

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 createDateFormatLocalizedFromUserInputs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static DateFormat createDateFormatLocalizedFromUserInputs(String localeLanguage, String localeCountry) {
        DateFormat f = null;
        if ((localeLanguage != null && !localeLanguage.isEmpty()) && (localeCountry != null && !localeCountry.isEmpty())) {
            Locale dateLocale = new Locale(localeLanguage, localeCountry);
            if (isLocaleValid(dateLocale)) {

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

There are no issues that match your filters.

Category
Status