Showing 239 of 795 total issues

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

    @Override
    public void createIndicatorChart(final AbstractOrderedLayout content,final List<WorldBankData> list,
            final ViewWorldbankIndicatorDataCountrySummary summary) {

        final Map<Country, List<WorldBankData>> countryIndicatorsMap = list.stream()

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 allowRoleInSecurityContext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static boolean allowRoleInSecurityContext(final String role) {
        boolean result = false;
        final SecurityContext context = SecurityContextHolder.getContext();
        if (context != null && context.getAuthentication() != null) {
            final Collection<? extends GrantedAuthority> authorities = context.getAuthentication().getAuthorities();

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 createPagingControls has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void createPagingControls(final AbstractOrderedLayout content, final String name, final String pageId, final Long size, final int pageNr,
            final int resultPerPage) {
                final HorizontalLayout pagingControls = new HorizontalLayout();
                pagingControls.setSpacing(true);

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 getStepMapping has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    protected StepMapping<AssignmentData> getStepMapping() {
        return new StepMapping<>() {

            @Override

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 unmarshallXml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public Object unmarshallXml(final Unmarshaller unmarshaller, final String accessUrl, final String nameSpace,
            final String replace, final String with) throws XmlAgentException {

        try {

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 getMinistryNames has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public List<String> getMinistryNames() {
        final Set<String> ministryNameSet = new HashSet<>();

        final Map<Integer, List<GovernmentBodyAnnualSummary>> data = getData();

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 getGovernmentBodyNames has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public List<String> getGovernmentBodyNames() {
        final Set<String> governmentBodyNameSet = new HashSet<>();

        final Map<Integer, List<GovernmentBodyAnnualSummary>> data = getData();

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 createDisplayPropertyConverters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static <T extends Serializable> void createDisplayPropertyConverters(final List<String> displayProperties,
            final ComponentContainer formContent, final Binder<T> binder, final PropertyDescriptor[] propertyDescriptors) {
        for (final String property : displayProperties) {
            final Class<?> typeOfProperty = getTypeOfProperty(propertyDescriptors, property);

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 createMinistrySummary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void createMinistrySummary(final AbstractOrderedLayout content, final String field, final String label) {
        final DataSeries dataSeries = new DataSeries();
        final Series series = new Series();

        final Map<String, List<GovernmentBodyAnnualOutcomeSummary>> reportByMinistry = esvApi.getGovernmentBodyReportByMinistry();

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 createContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
    @Override
    public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
        final VerticalLayout panelContent = createPanelContent();

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 addDataSeries has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addDataSeries(final SimpleDateFormat simpleDateFormat,
            final SimpleDateFormat parseInputDateFormat, final DataSeries dataSeries, final Series series,
            final Entry<String, List<ViewRiksdagenDocumentTypeDailySummary>> entry) {

        series.addSeries(new XYseries().setLabel(entry.getKey()));

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 addDocumentHistoryByPartyData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addDocumentHistoryByPartyData(final DataSeries dataSeries, final Series series,
            final Map<String, List<ViewRiksdagenPartyDocumentDailySummary>> map) {
        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);

        for (final Entry<String, List<ViewRiksdagenPartyDocumentDailySummary>> entry : map.entrySet()) {

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 bestGuessVoteDate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static Date bestGuessVoteDate(final BallotContainer ballotContainer) throws ParseException {
        final com.hack23.cia.model.external.riksdagen.votering.impl.BallotDocumentElement ballotDocumentElement = ballotContainer.getBallotDocumentElement();
        Date result;

        final String createdDate=ballotContainer.getBallotDocumentElement().getCreatedDate();

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 addDocTypeDecisionDataRows has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addDocTypeDecisionDataRows(final SankeyChart chart,
            final Entry<String, List<ProposalCommitteeeSummary>> entry) {
        final Map<String, List<ProposalCommitteeeSummary>> docTypeMap = entry.getValue().stream()
                .collect(Collectors.groupingBy(ProposalCommitteeeSummary::getDocType));

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 generateWorkOrders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void generateWorkOrders() {
        try {
            final Map<String, String> documentStatusContainerMap = getImportService()
                    .getDocumentStatusContainerMap();

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 addDocumentHistoryByPersonData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addDocumentHistoryByPersonData(final SimpleDateFormat simpleDateFormat,
            final DataSeries dataSeries, final Series series,
            final Map<String, List<ViewRiksdagenPoliticianDocumentDailySummary>> map) {
        for (final Entry<String, List<ViewRiksdagenPoliticianDocumentDailySummary>> entry : map.entrySet()) {

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 getGovernmentBodyNames has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public List<String> getGovernmentBodyNames(final String ministry) {
        final Map<String, Set<String>> governmentBodyNameSetMinistryMap = new HashMap<>();

        final Set<String> governmentBodyNameSetMapEntry = new HashSet<>();

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 addCommiteeSummary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addCommiteeSummary(final StringBuilder stringBuilder,
            final Entry<String, List<ProposalCommitteeeSummary>> entry,
            final Optional<ViewRiksdagenCommittee> vewRiksdagenCommittee) {
        if (vewRiksdagenCommittee.isPresent()) {

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 addEntryData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addEntryData(final DataSeries dataSeries, final SimpleDateFormat simpleDateFormat,
            final Entry<String, List<GovernmentBodyAnnualOutcomeSummary>> entry) {
        for (final GovernmentBodyAnnualOutcomeSummary data : entry.getValue()) {
            final Map<Date, Double> valueMap = data.getValueMap();

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

Avoid too many return statements within this method.
Open

        return sortedEntries;
    Severity
    Category
    Status
    Source
    Language