sjsucohort6/amigo-chatbot

View on GitHub
slackbot-service/src/main/java/edu/sjsu/amigo/slackbot/MessageListener.java

Summary

Maintainability
A
0 mins
Test Coverage

Using the '.*' form of import should be avoided - edu.sjsu.amigo.scheduler.jobs.JobConstants.*.
Open

import static edu.sjsu.amigo.scheduler.jobs.JobConstants.*;

Checks that there are no import statements that use the * notation.

Rationale: Importing all classes from a package or staticmembers from a class leads to tight coupling between packagesor classes and might lead to problems when a new version of alibrary introduces name clashes.

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

Distance between variable 'groupName' declaration and its first usage is 7, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
Open

                String groupName = JOB_GRP_SLACKBOT;

Checks the distance between declaration of variable and its first usage.Note : Variable declaration/initialization statements are not countedwhile calculating length.

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

            // Get the text after <@BOT_ID> for example, from "@amigo aws iam list-users" get "aws iam list-users".

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.logging.Level' import. Should be before 'org.quartz.SchedulerException'.
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.

Extra separation in import group before 'edu.sjsu.amigo.scheduler.jobs.JobConstants.*'
Open

import static edu.sjsu.amigo.scheduler.jobs.JobConstants.*;

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.

First sentence of Javadoc is missing an ending period.
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 113).
Open

                JobManager.getInstance().scheduleJob(SlackMessageProcessorJob.class, jobName, groupName, params);

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.

Extra separation in import group before 'java.io.IOException'
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.

Wrong lexicographical order for 'java.io.IOException' import. Should be before 'org.quartz.SchedulerException'.
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.

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

                logger.info("Received message from " + messageSender + " content [" + messageContent + "]");

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.

Distance between variable 'jobName' declaration and its first usage is 7, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
Open

                String jobName = "SLACK-MESG-JOB-" + UUID.randomUUID().toString();

Checks the distance between declaration of variable and its first usage.Note : Variable declaration/initialization statements are not countedwhile calculating length.

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

 * Listens to messages sent on channels amigo chatbot joined on slack or messges sent directly to it.

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.

At-clause should have a non-empty description.
Open

     * @return

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

    private void processUserMessage(String messageContent, SlackUser messageSender, SlackSession session, SlackChannel channel) {

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.UUID' import. Should be before 'org.quartz.SchedulerException'.
Open

import java.util.UUID;

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 'edu.sjsu.amigo.scheduler.jobs.JobConstants.*' import. Should be before 'org.quartz.SchedulerException'.
Open

import static edu.sjsu.amigo.scheduler.jobs.JobConstants.*;

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.Logger' import. Should be before 'org.quartz.SchedulerException'.
Open

import java.util.logging.Logger;

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.

'static' modifier out of order with the JLS suggestions.
Open

    private final static Logger logger = Logger.getLogger(MessageListener.class.getName());

Checks that the order of modifiers conforms to the suggestions inthe JavaLanguage specification, ยง 8.1.1, 8.3.1, 8.4.3 and9.4. The correct order is:

  1. public
  2. protected
  3. private
  4. abstract
  5. default
  6. static
  7. sealed
  8. non-sealed
  9. final
  10. transient
  11. volatile
  12. synchronized
  13. native
  14. strictfp

In additional, modifiers are checked to ensure all annotations aredeclared before all other modifiers.

Rationale: Code is easier to read if everybody follows a standard.

ATTENTION: We skiptype annotations from validation.

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

At-clause should have a non-empty description.
Open

     * @param messageContent

There are no issues that match your filters.

Category
Status