Showing 55 of 84 total issues
Resource
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
@Entity
public class Resource extends AbstractComparableByContest {
public static final String DNS = "DNS";
public static final String HTTP = "HTTP";
Method call
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
@Override
public String call() {
while (contest.isEnabled()) {
// Check to see if it's time to start actually polling this contest
- 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
Contest
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
@Entity
public class Contest extends AbstractEntity {
@Column(nullable = false, unique = true)
private String name;
Team
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
@Entity
public class Team extends AbstractComparableByContest {
@Column(nullable = false)
private String name;
Method lookup
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static String lookup(String hostAddress, int hostPort, String query, int type,
boolean tcp, boolean recursive, int timeout, boolean firstOnly) {
try {
// Set up the resolution options
- 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 doPoll
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Poll doPoll() {
Poll newPoll = new Poll();
newPoll.setResource(resource);
Method compareTo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
@Override
public int compareTo(User o) {
// If one is an admin, but not the other, decide based on that
if (this.isAdmin() && !o.isAdmin()) {
- 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 checkTeamNameAndFlagAreUniqueInContest
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private void checkTeamNameAndFlagAreUniqueInContest(Team entity) throws ValidationException {
if (null != entity.getContest()) {
List<Team> others = repo.findByContest(entity.getContest().getId());
for (Team t : others) {
if (!t.equalByUUID(entity)) {
- 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 doPoll
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Poll doPoll() {
Poll newPoll = new Poll();
newPoll.setResource(resource);
- 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 doPoll
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Poll doPoll() {
Poll newPoll = new Poll();
newPoll.setResource(resource);
Method createParameters
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public List<Parameter> createParameters(Resource resource) throws ValidationException {
// Create the correct parameters for the resource
List<Parameter> parameters;
switch (resource.getType()) {
Method lookup
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static String lookup(String hostAddress, int hostPort, String query, int type,
boolean tcp, boolean recursive, int timeout, boolean firstOnly) {
try {
// Set up the resolution options
Method filterSupportedTypes
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static String filterSupportedTypes(Record[] records, int type, boolean firstOnly) {
StringBuilder result = new StringBuilder();
for (Record r : records) {
switch (type) {
case A:
Method doPoll
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Poll doPoll() {
setParameters();
Method doPoll
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Poll doPoll() {
Poll newPoll = new Poll();
newPoll.setResource(resource);
- 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 createParameters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public List<Parameter> createParameters(Resource resource) throws ValidationException {
// Create the correct parameters for the resource
List<Parameter> parameters;
switch (resource.getType()) {
- 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 doPoll
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Poll doPoll() {
Poll newPoll = new Poll();
newPoll.setResource(resource);
- 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 compare
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
int compare(AbstractComparableByContest e1, AbstractComparableByContest e2) {
// If both are assigned to contests, decide based on which contest is running
if (null != e1.getContest() && null != e2.getContest()) {
- 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 convertStrings
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void convertStrings() {
tcp = tcpString.equals(Parameter.TRUE);
recursive = recursiveString.equals(Parameter.TRUE);
Method sendSMTPMessage
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public static void sendSMTPMessage(String sender, String password, String host,
String recipient, String subject, String msg,
int port, boolean tls, boolean ssl, int timeout)