Jasig/WebproxyPortlet

View on GitHub
src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletController.java

Summary

Maintainability
A
3 hrs
Test Coverage

Method prepareGatewayResponse has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private void prepareGatewayResponse(ResourceRequest portletRequest, ResourceResponse portletResponse,
                                        String beanName, Model model) throws IOException {
        // get the requested gateway link entry from the list configured for
        // this portlet
        final List<GatewayEntry> entries =  gatewayEntries;

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 prepareGatewayResponse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void prepareGatewayResponse(ResourceRequest portletRequest, ResourceResponse portletResponse,
                                        String beanName, Model model) throws IOException {
        // get the requested gateway link entry from the list configured for
        // this portlet
        final List<GatewayEntry> entries =  gatewayEntries;

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

        @RenderMapping
        public ModelAndView getView(RenderRequest request){
            final ModelAndView mv = new ModelAndView();
            final List<GatewayEntry> entries =  removeInaccessibleEntries(gatewayEntries, request);
            final Map<String, Boolean> validations = new HashMap<String, Boolean>();

    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

    There are no issues that match your filters.

    Category
    Status