groupdocs-annotation/GroupDocs.Annotation-for-Java-Spring

View on GitHub
src/main/java/com/groupdocs/ui/annotation/util/AnnotationMapper.java

Summary

Maintainability
B
6 hrs
Test Coverage
F
0%

Method mapAnnotationDataEntity has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public static AnnotationDataEntity mapAnnotationDataEntity(AnnotationBase annotationInfo, PageInfo pageInfo) {
        String annotationTypeName = AnnotationType.getName(annotationInfo.getType()); //getAnnotationType(annotationInfo.getType()); //Enum.GetName(Operators.typeOf(AnnotationType.class), annotationInfo.getType());
        float maxY = 0, minY = 0, maxX = 0, minX = 0;
        float boxX = 0, boxY = 0, boxHeight = 0, boxWidth = 0;
        String svgPath = "";
Severity: Minor
Found in src/main/java/com/groupdocs/ui/annotation/util/AnnotationMapper.java - About 3 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

Method mapAnnotationDataEntity has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static AnnotationDataEntity mapAnnotationDataEntity(AnnotationBase annotationInfo, PageInfo pageInfo) {
        String annotationTypeName = AnnotationType.getName(annotationInfo.getType()); //getAnnotationType(annotationInfo.getType()); //Enum.GetName(Operators.typeOf(AnnotationType.class), annotationInfo.getType());
        float maxY = 0, minY = 0, maxX = 0, minX = 0;
        float boxX = 0, boxY = 0, boxHeight = 0, boxWidth = 0;
        String svgPath = "";
Severity: Major
Found in src/main/java/com/groupdocs/ui/annotation/util/AnnotationMapper.java - About 2 hrs to fix

    There are no issues that match your filters.

    Category
    Status