Showing 10 of 15 total issues
Method manipulatingFlattenJson
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private void manipulatingFlattenJson(final JsonElement in, final String prefix)
{
if (in.isJsonObject()) {
final JsonObject obj = in.getAsJsonObject();
// NOTE: If you want to flatten JSON completely, please remove this if and addHeuristicValue
- 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 addRecord
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void addRecord(final Issue issue, final Schema schema, final PluginTask task, final PageBuilder pageBuilder)
{
schema.visitColumns(new ColumnVisitor() {
@Override
public void jsonColumn(final Column column)
Method searchJiraAPI
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String searchJiraAPI(final PluginTask task, final int startAt, final int maxResults)
{
try {
return RetryExecutor.builder()
.withRetryLimit(task.getRetryLimit())
Method manipulatingFlattenJson
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void manipulatingFlattenJson(final JsonElement in, final String prefix)
{
if (in.isJsonObject()) {
final JsonObject obj = in.getAsJsonObject();
// NOTE: If you want to flatten JSON completely, please remove this if and addHeuristicValue
Method get
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private JsonElement get(final JsonElement json, final List<String> keys)
{
if (json == null || json.isJsonNull()) {
return JsonNull.INSTANCE;
}
- 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 validateTaskConfig
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void validateTaskConfig(final PluginTask task)
{
final String username = task.getUsername();
if (isNullOrEmpty(username)) {
throw new ConfigException("Username or email could not be empty");
Method transaction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public ConfigDiff transaction(final ConfigSource config,
final InputPlugin.Control control)
{
final PluginTask task = CONFIG_MAPPER.map(config, 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 addHeuristicValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void addHeuristicValue(final JsonObject json, final String prefix)
{
final List<String> keys = Arrays.asList("name", "key", "id");
final List<String> heuristic = new ArrayList<>();
for (final Entry<String, JsonElement> entry : json.entrySet()) {
- 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 validateTaskConfig
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static void validateTaskConfig(final PluginTask task)
{
final String username = task.getUsername();
if (isNullOrEmpty(username)) {
throw new ConfigException("Username or email could not be empty");
- 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 createGuessSample
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private List<LinkedHashMap<String, Object>> createGuessSample(final List<Issue> issues, final Set<String> uniqueAttributes)
{
final List<LinkedHashMap<String, Object>> samples = new ArrayList<>();
for (final Issue issue : issues) {
final JsonObject flatten = issue.getFlatten();
- 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"