pmonks/alfresco-bulk-import

View on GitHub
amp/src/main/java/org/alfresco/extension/bulkimport/impl/Scanner.java

Summary

Maintainability
D
2 days
Test Coverage

Method run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void run()
    {
        boolean inPlacePossible = false;
        
Severity: Minor
Found in amp/src/main/java/org/alfresco/extension/bulkimport/impl/Scanner.java - About 4 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

File Scanner.java has 330 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2007 Peter Monks
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Minor
Found in amp/src/main/java/org/alfresco/extension/bulkimport/impl/Scanner.java - About 3 hrs to fix

    Method run has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public void run()
        {
            boolean inPlacePossible = false;
            
    Severity: Major
    Found in amp/src/main/java/org/alfresco/extension/bulkimport/impl/Scanner.java - About 2 hrs to fix

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

              @Override
              public void run()
              {
                  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 submitCurrentBatch has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          private synchronized void submitCurrentBatch()
              throws InterruptedException
          {
              // Implement pauses at batch boundaries only
              pauser.blockIfPaused();

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

          private final void logStatusInfo()
          {
              if (info(log))
              {
                  try

        Method submitBatch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            private void submitBatch(final Batch batch)
            {
                if (batch        != null &&
                    batch.size() >  0)
                {
        Severity: Minor
        Found in amp/src/main/java/org/alfresco/extension/bulkimport/impl/Scanner.java - About 55 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 logStatusInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private final void logStatusInfo()
            {
                if (info(log))
                {
                    try
        Severity: Minor
        Found in amp/src/main/java/org/alfresco/extension/bulkimport/impl/Scanner.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 submit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            @Override
            @SuppressWarnings({"rawtypes", "unchecked"})
            public synchronized void submit(final BulkImportItem item)
                throws InterruptedException
            {
        Severity: Minor
        Found in amp/src/main/java/org/alfresco/extension/bulkimport/impl/Scanner.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

        There are no issues that match your filters.

        Category
        Status