sjsucohort6/amigo-chatbot

View on GitHub
command-db/src/main/java/edu/sjsu/amigo/command/db/model/Provider.java

Summary

Maintainability
A
35 mins
Test Coverage

Method isValid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean isValid() throws ValidationException {
        boolean isValid = isReqd(cloudProvider);
        if (isValid) {
            for (Command command: commands) {
Severity: Minor
Found in command-db/src/main/java/edu/sjsu/amigo/command/db/model/Provider.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

Extra separation in import group before 'java.util.ArrayList'
Open

import java.util.ArrayList;

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

'+' should be on a new line.
Open

                "cloudProvider='" + cloudProvider + '\'' +

Wrong lexicographical order for 'java.util.ArrayList' import. Should be before 'org.mongodb.morphia.annotations.Id'.
Open

import java.util.ArrayList;

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

'+' should be on a new line.
Open

        return "Provider{" +

'+' should be on a new line.
Open

                ", commands=" + commands +

'+' should be on a new line.
Open

                ", dockerImage='" + dockerImage + '\'' +

Wrong lexicographical order for 'java.util.List' import. Should be before 'org.mongodb.morphia.annotations.Id'.
Open

import java.util.List;

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Line is longer than 100 characters (found 110).
Open

 * Represents a cloud provider and the commands that can be executed on the provider for each inferred intent.

Checks for long lines.

Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

There are no issues that match your filters.

Category
Status