konikvranik/jtoggl

View on GitHub

Showing 50 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

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/User.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/Project.java on lines 107..120
src/main/java/ch/simas/jtoggl/domain/ProjectClient.java on lines 108..121
src/main/java/ch/simas/jtoggl/domain/ProjectUser.java on lines 102..115
src/main/java/ch/simas/jtoggl/domain/Tag.java on lines 88..101
src/main/java/ch/simas/jtoggl/domain/Task.java on lines 130..143
src/main/java/ch/simas/jtoggl/domain/TimeEntry.java on lines 202..215
src/main/java/ch/simas/jtoggl/domain/Workspace.java on lines 74..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/Workspace.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/Project.java on lines 107..120
src/main/java/ch/simas/jtoggl/domain/ProjectClient.java on lines 108..121
src/main/java/ch/simas/jtoggl/domain/ProjectUser.java on lines 102..115
src/main/java/ch/simas/jtoggl/domain/Tag.java on lines 88..101
src/main/java/ch/simas/jtoggl/domain/Task.java on lines 130..143
src/main/java/ch/simas/jtoggl/domain/TimeEntry.java on lines 202..215
src/main/java/ch/simas/jtoggl/domain/User.java on lines 185..198

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/Tag.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/Project.java on lines 107..120
src/main/java/ch/simas/jtoggl/domain/ProjectClient.java on lines 108..121
src/main/java/ch/simas/jtoggl/domain/ProjectUser.java on lines 102..115
src/main/java/ch/simas/jtoggl/domain/Task.java on lines 130..143
src/main/java/ch/simas/jtoggl/domain/TimeEntry.java on lines 202..215
src/main/java/ch/simas/jtoggl/domain/User.java on lines 185..198
src/main/java/ch/simas/jtoggl/domain/Workspace.java on lines 74..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/ProjectUser.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/Project.java on lines 107..120
src/main/java/ch/simas/jtoggl/domain/ProjectClient.java on lines 108..121
src/main/java/ch/simas/jtoggl/domain/Tag.java on lines 88..101
src/main/java/ch/simas/jtoggl/domain/Task.java on lines 130..143
src/main/java/ch/simas/jtoggl/domain/TimeEntry.java on lines 202..215
src/main/java/ch/simas/jtoggl/domain/User.java on lines 185..198
src/main/java/ch/simas/jtoggl/domain/Workspace.java on lines 74..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/TimeEntry.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/Project.java on lines 107..120
src/main/java/ch/simas/jtoggl/domain/ProjectClient.java on lines 108..121
src/main/java/ch/simas/jtoggl/domain/ProjectUser.java on lines 102..115
src/main/java/ch/simas/jtoggl/domain/Tag.java on lines 88..101
src/main/java/ch/simas/jtoggl/domain/Task.java on lines 130..143
src/main/java/ch/simas/jtoggl/domain/User.java on lines 185..198
src/main/java/ch/simas/jtoggl/domain/Workspace.java on lines 74..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/ProjectClient.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/Project.java on lines 107..120
src/main/java/ch/simas/jtoggl/domain/ProjectUser.java on lines 102..115
src/main/java/ch/simas/jtoggl/domain/Tag.java on lines 88..101
src/main/java/ch/simas/jtoggl/domain/Task.java on lines 130..143
src/main/java/ch/simas/jtoggl/domain/TimeEntry.java on lines 202..215
src/main/java/ch/simas/jtoggl/domain/User.java on lines 185..198
src/main/java/ch/simas/jtoggl/domain/Workspace.java on lines 74..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/Task.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/Project.java on lines 107..120
src/main/java/ch/simas/jtoggl/domain/ProjectClient.java on lines 108..121
src/main/java/ch/simas/jtoggl/domain/ProjectUser.java on lines 102..115
src/main/java/ch/simas/jtoggl/domain/Tag.java on lines 88..101
src/main/java/ch/simas/jtoggl/domain/TimeEntry.java on lines 202..215
src/main/java/ch/simas/jtoggl/domain/User.java on lines 185..198
src/main/java/ch/simas/jtoggl/domain/Workspace.java on lines 74..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
Severity: Major
Found in src/main/java/ch/simas/jtoggl/domain/Project.java and 7 other locations - About 1 hr to fix
src/main/java/ch/simas/jtoggl/domain/ProjectClient.java on lines 108..121
src/main/java/ch/simas/jtoggl/domain/ProjectUser.java on lines 102..115
src/main/java/ch/simas/jtoggl/domain/Tag.java on lines 88..101
src/main/java/ch/simas/jtoggl/domain/Task.java on lines 130..143
src/main/java/ch/simas/jtoggl/domain/TimeEntry.java on lines 202..215
src/main/java/ch/simas/jtoggl/domain/User.java on lines 185..198
src/main/java/ch/simas/jtoggl/domain/Workspace.java on lines 74..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

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
Severity
Category
Status
Source
Language