konikvranik/jtoggl

View on GitHub

Showing 24 of 50 total issues

Method getJsonParser has 138 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private JsonParser getJsonParser(final String value) {
        return new JsonParser() {
            @Override
            public ObjectCodec getCodec() {
                return null;
Severity: Major
Found in src/test/java/ch/simas/jtoggl/CustomDateDeserializerTest.java - About 5 hrs to fix

CustomDateDeserializerTest has 38 methods (exceeds 20 allowed). Consider refactoring.
Open

public class CustomDateDeserializerTest {

    public static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");

    @Test(enabled = false)
Severity: Minor
Found in src/test/java/ch/simas/jtoggl/CustomDateDeserializerTest.java - About 5 hrs to fix

JToggl has 38 methods (exceeds 20 allowed). Consider refactoring.
Open

public class JToggl {

    /**
     * Root URL for API.
     */
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/JToggl.java - About 5 hrs to fix

File JToggl.java has 351 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jtoggl - Java Wrapper for Toggl REST API https://www.toggl.com/public/api
 *
 * Copyright (C) 2011 by simas GmbH, Moosentli 7, 3235 Erlach, Switzerland
 * http://www.simas.ch
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/JToggl.java - About 4 hrs to fix

TimeEntry has 32 methods (exceeds 20 allowed). Consider refactoring.
Open

@JsonRootName("time_entry")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TimeEntry implements Cloneable, WithWorkspace, WithId, WithProject {

    @JsonProperty("id")
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/TimeEntry.java - About 4 hrs to fix

User has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

@JsonRootName("user")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class User implements Cloneable, WithId {

    @JsonProperty("id")
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/User.java - About 3 hrs to fix

File JTogglTest.java has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jtoggl - Java Wrapper for Toggl REST API https://www.toggl.com/public/api
 *
 * Copyright (C) 2011 by simas GmbH, Moosentli 7, 3235 Erlach, Switzerland
 * http://www.simas.ch
Severity: Minor
Found in src/test/java/ch/simas/jtoggl/JTogglTest.java - About 2 hrs to fix

JTogglTest has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

@Test
public class JTogglTest {

    private static JToggl jToggl;
    private static TimeEntry timeEntry;
Severity: Minor
Found in src/test/java/ch/simas/jtoggl/JTogglTest.java - About 2 hrs to fix

Task has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

@JsonRootName("task")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Task implements Cloneable, WithWorkspace, WithUser, WithProject, WithId {

    @JsonProperty("id")
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/Task.java - About 2 hrs to fix

ProjectUser has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

@JsonRootName("user")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ProjectUser implements Cloneable, WithWorkspace, WithUser, WithId {

    @JsonProperty("id")
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/ProjectUser.java - About 2 hrs to fix

Method stripe has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static <T extends Cloneable & WithId> T stripe(T clientObject) {
        if (clientObject instanceof WithWorkspace) {
            WithWorkspace ww = (WithWorkspace) clientObject;
            if (((WithWorkspace) clientObject).getWorkspaceId() == null && ((WithWorkspace) clientObject).getWorkspace() != null) {
                ww.setWorkspaceId(ww.getWorkspace().getId());
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/JToggl.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 beforeClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @BeforeClass
    public static void beforeClass() throws Exception {

        String togglUsername = System.getenv("TOGGL_USERNAME");
        if (togglUsername == null) {
Severity: Minor
Found in src/test/java/ch/simas/jtoggl/JTogglTest.java - About 1 hr to fix

Method beforeClass has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    @BeforeClass
    public static void beforeClass() throws Exception {

        String togglUsername = System.getenv("TOGGL_USERNAME");
        if (togglUsername == null) {
Severity: Minor
Found in src/test/java/ch/simas/jtoggl/JTogglTest.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 startStopTimeEntry has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Test(dependsOnMethods = "createProject")
    public void startStopTimeEntry() throws Exception {
        TimeEntry current = jToggl.getCurrentTimeEntry();
        Assert.assertNull(current);

Severity: Minor
Found in src/test/java/ch/simas/jtoggl/JTogglTest.java - About 1 hr to fix

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

    @Test(dependsOnMethods = {"createClient"})
    public void createProject() {
        List<Project> projects = jToggl.getProjects();
        if (projects != null) {
            for (Project project : projects) {
Severity: Minor
Found in src/test/java/ch/simas/jtoggl/JTogglTest.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

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

    @Test(dependsOnMethods = {"getWorkspaces"})
    public void createClient() {
        ProjectClient cl = new ProjectClient();
        cl.setName("JUnit Client");
        cl.setWorkspace(workspace);
Severity: Minor
Found in src/test/java/ch/simas/jtoggl/JTogglTest.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

Method equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/ProjectUser.java - About 25 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

Method equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/Project.java - About 25 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

Method equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/User.java - About 25 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

Method equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Minor
Found in src/main/java/ch/simas/jtoggl/domain/Tag.java - About 25 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

Severity
Category
Status
Source
Language