Showing 31 of 49 total issues
Method getDataFromPath
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@Override
public JsonNode getDataFromPath(final String path, final int page, final boolean isPreview, final long startTime)
{
Preconditions.checkArgument(isPreview, "IsPreview should be true to use this method");
- 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 storeStartTimeForConfigDiff
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void storeStartTimeForConfigDiff(final TaskReport taskReport, final long initStartTime, final long resultEndTime)
{
if (task.getIncremental()) {
long nextStartTime;
long now = Instant.now().getEpochSecond();
- 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 sendGetRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String sendGetRequest(final String url, final PluginTask task)
throws ZendeskException
{
try {
final HttpClient client = createHttpClient();
Method isContinue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected boolean isContinue(final JsonNode jsonNode, final Consumer<? super JsonNode> action)
{
final Iterator<JsonNode> iterator = ZendeskUtils.getListRecords(jsonNode, task.getTarget().getJsonName());
- 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 validateCredentials
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private void validateCredentials(PluginTask task)
{
switch (task.getAuthenticationMethod()) {
case OAUTH:
if (!task.getAccessToken().isPresent()) {
- 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 tryAdvance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean tryAdvance(final Consumer<? super JsonNode> action)
{
try {
final String result = zendeskRestClient.doGet(path, task, isPreview);
- 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
Avoid deeply nested control flow statements. Open
if (type.equals(Types.TIMESTAMP.getName())) {
entry.remove("format");
}
Method validateIncremental
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void validateIncremental(PluginTask task)
{
if (task.getIncremental() && getZendeskService(task).isSupportIncremental()) {
if (!task.getDedup()) {
logger.warn("You've selected to skip de-duplicating records, result may contain duplicated data");
- 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
Avoid too many return
statements within this method. Open
return true;
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public TaskReport run(final TaskSource taskSource, final Schema schema, final int taskIndex, final PageOutput output)
{
final PluginTask task = TASK_MAPPER.map(taskSource, PluginTask.class);
- 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 unifiedFieldNames
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private List<String> unifiedFieldNames(JsonNode jsonNode, String targetJsonName)
{
List<String> columnNames = new ArrayList<>();
Iterator<JsonNode> records = ZendeskUtils.getListRecords(jsonNode, targetJsonName);
while (records.hasNext()) {
- 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"