sjsucohort6/amigo-chatbot

View on GitHub
riabot-service/src/main/java/edu/sjsu/amigo/riabot/jobs/RiabotMessageProcessorJob.java

Summary

Maintainability
A
2 hrs
Test Coverage

Method execute has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            JobDataMap jobDataMap = jobExecutionContext.getMergedJobDataMap();
            message = (RiaMessage)jobDataMap.get(JobConstants.JOB_PARAM_MESSAGE);

    Method execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        @Override
        public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
            try {
                JobDataMap jobDataMap = jobExecutionContext.getMergedJobDataMap();
                message = (RiaMessage)jobDataMap.get(JobConstants.JOB_PARAM_MESSAGE);

    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

    Wrong lexicographical order for 'java.text.MessageFormat' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import java.text.MessageFormat;

    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.

    Wrong lexicographical order for 'javax.ws.rs.client.Entity' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import javax.ws.rs.client.Entity;

    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.

    Wrong lexicographical order for 'java.io.IOException' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import java.io.IOException;

    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.

    Extra separation in import group before 'javax.ws.rs.client.Client'
    Open

    import javax.ws.rs.client.Client;

    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.

    Wrong lexicographical order for 'javax.ws.rs.core.HttpHeaders' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import javax.ws.rs.core.HttpHeaders;

    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 126).
    Open

                    log.info(MessageFormat.format("Sending message to chatbot [{0}] at [{1}]", jsonStr, BASE_URI + RESOURCE_URI));

    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.

    Wrong lexicographical order for 'java.util.Date' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import java.util.Date;

    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.

    Wrong lexicographical order for 'javax.ws.rs.client.ClientBuilder' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import javax.ws.rs.client.ClientBuilder;

    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.

    Wrong lexicographical order for 'javax.ws.rs.core.Response' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import javax.ws.rs.core.Response;

    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.

    Wrong lexicographical order for 'javax.ws.rs.client.Client' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import javax.ws.rs.client.Client;

    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.

    Wrong lexicographical order for 'javax.ws.rs.client.WebTarget' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import javax.ws.rs.client.WebTarget;

    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.

    Wrong lexicographical order for 'java.util.logging.Level' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import java.util.logging.Level;

    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.

    Summary javadoc is missing.
    Open

    /**

    Checks thatJavadoc summary sentence does not contain phrases that are not recommended to use.Summaries that contain only the {@inheritDoc} tag are skipped. Check alsoviolate Javadoc that does not contain first sentence.

    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 132).
    Open

                            log.severe(MessageFormat.format("Failed to send the message [{0}] to chatbot service", message.toString()));

    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.

    Wrong lexicographical order for 'javax.ws.rs.core.MediaType' import. Should be before 'org.quartz.JobExecutionException'.
    Open

    import javax.ws.rs.core.MediaType;

    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.

    There are no issues that match your filters.

    Category
    Status