nstickney/CyBearPit

View on GitHub

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";
Severity: Minor
Found in beanpoll/src/main/java/is/stma/beanpoll/model/Resource.java - About 3 hrs to fix

    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
    Severity: Minor
    Found in beanpoll/src/main/java/is/stma/beanpoll/poller/JudgeCallable.java - About 2 hrs 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

    Contest has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @Entity
    public class Contest extends AbstractEntity {
    
        @Column(nullable = false, unique = true)
        private String name;
    Severity: Minor
    Found in beanpoll/src/main/java/is/stma/beanpoll/model/Contest.java - About 2 hrs to fix

      Team has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @Entity
      public class Team extends AbstractComparableByContest {
      
          @Column(nullable = false)
          private String name;
      Severity: Minor
      Found in beanpoll/src/main/java/is/stma/beanpoll/model/Team.java - About 2 hrs to fix

        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
        Severity: Minor
        Found in beanpoll/src/main/java/is/stma/beanpoll/util/DNSUtility.java - About 1 hr 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

        Method doPoll has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            public Poll doPoll() {
        
                Poll newPoll = new Poll();
                newPoll.setResource(resource);
        Severity: Minor
        Found in beanpoll/src/main/java/is/stma/beanpoll/poller/FTPPoller.java - About 1 hr to fix

          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()) {
          Severity: Minor
          Found in beanpoll/src/main/java/is/stma/beanpoll/model/User.java - About 1 hr 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

          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)) {
          Severity: Minor
          Found in beanpoll/src/main/java/is/stma/beanpoll/rules/TeamRules.java - About 1 hr 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

          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);
          Severity: Minor
          Found in beanpoll/src/main/java/is/stma/beanpoll/poller/FTPPoller.java - About 1 hr 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

          Method doPoll has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public Poll doPoll() {
          
                  Poll newPoll = new Poll();
                  newPoll.setResource(resource);
          Severity: Minor
          Found in beanpoll/src/main/java/is/stma/beanpoll/poller/EmailPoller.java - About 1 hr to fix

            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
              Severity: Minor
              Found in beanpoll/src/main/java/is/stma/beanpoll/util/DNSUtility.java - About 1 hr to fix

                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:
                Severity: Minor
                Found in beanpoll/src/main/java/is/stma/beanpoll/util/DNSUtility.java - About 1 hr to fix

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

                      @Override
                      public Poll doPoll() {
                  
                          setParameters();
                  
                  
                  Severity: Minor
                  Found in beanpoll/src/main/java/is/stma/beanpoll/poller/SMTPPoller.java - About 1 hr to fix

                    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);
                    Severity: Minor
                    Found in beanpoll/src/main/java/is/stma/beanpoll/poller/HTTPPoller.java - About 1 hr 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

                    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()) {

                    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);
                    Severity: Minor
                    Found in beanpoll/src/main/java/is/stma/beanpoll/poller/EmailPoller.java - About 1 hr 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

                    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()) {
                    
                    

                    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);
                    
                    
                    Severity: Minor
                    Found in beanpoll/src/main/java/is/stma/beanpoll/poller/DNSPoller.java - About 1 hr to fix

                      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)
                      Severity: Major
                      Found in beanpoll/src/main/java/is/stma/beanpoll/util/EmailUtility.java - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language