CloudSlang/score

View on GitHub

Showing 3,943 of 3,943 total issues

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

    private void registerAplsLicensingService(Element element, ParserContext parserContext) {
        String registerAplsLicensingService = element.getAttribute("registerAplsLicensingService");
        if (!FALSE.toString().equals(registerAplsLicensingService)) {
            new BeanRegistrator(parserContext)
                    .NAME("aplsLicensingService")
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 189..197
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 206..214
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 216..224
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 227..235
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 251..259
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 271..279
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 281..289

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 47.

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

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

    private void registerSequentialExecution(Element element, ParserContext parserContext) {
        String registerSequentialExecutionService = element.getAttribute("registerSequentialExecutionService");
        if (!FALSE.toString().equals(registerSequentialExecutionService)) {
            new BeanRegistrator(parserContext)
                    .NAME("sequentialExecutionService")
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 206..214
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 216..224
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 227..235
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 251..259
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 261..269
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 271..279
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 281..289

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 47.

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

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

    private void registerPythonExecutorConfigurationDataService(Element element, ParserContext parserContext) {
        String registerPythonExecutorConfigurationDataService = element.getAttribute("stubPythonExecutorConfigurationDataService");
        if (!FALSE.toString().equals(registerPythonExecutorConfigurationDataService)) {
            new BeanRegistrator(parserContext)
                    .NAME("stubPythonExecutorConfigurationDataService")
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 189..197
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 206..214
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 216..224
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 227..235
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 251..259
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 261..269
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 281..289

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 47.

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

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

    private void registerExecutionPreconditionService(Element element, ParserContext parserContext) {
        String registerPreconditionService = element.getAttribute("registerExecutionPreconditionService");
        if (!FALSE.toString().equals(registerPreconditionService)) {
            new BeanRegistrator(parserContext)
                    .NAME("executionPreconditionService")
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 189..197
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 206..214
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 227..235
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 251..259
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 261..269
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 271..279
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 281..289

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 47.

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

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

    private void registerRobotAvailabilityService(Element element, ParserContext parserContext) {
        String registerRobotAvailabilityService = element.getAttribute("registerRobotAvailabilityService");
        if (!FALSE.toString().equals(registerRobotAvailabilityService)) {
            new BeanRegistrator(parserContext)
                    .NAME("robotAvailabilityService")
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 189..197
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 216..224
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 227..235
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 251..259
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 261..269
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 271..279
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 281..289

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 47.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    public void executionRecoveryJob() {
        if (logger.isDebugEnabled()) {
            logger.debug("ExecutionRecoveryJob woke up at " + new Date());
        }
engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java on lines 154..166

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 47.

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

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

    private void registerPythonExecutorCommunicationService(Element element, ParserContext parserContext) {
        String registerPythonExecutorCommunicationService = element.getAttribute("stubPythonExecutorCommunicationService");
        if (!FALSE.toString().equals(registerPythonExecutorCommunicationService)) {
            new BeanRegistrator(parserContext)
                    .NAME("stubPythonExecutorCommunicationService")
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 189..197
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 206..214
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 216..224
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 227..235
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 251..259
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 261..269
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 271..279

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 47.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    public void startDrain() {
        if (logger.isDebugEnabled()) {
            logger.debug("In SynchronizationManager.startDrain()");
        }
worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SynchronizationManagerImpl.java on lines 139..153

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 47.

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

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

    private void registerQueueConfigurationDataService(Element element, ParserContext parserContext) {
        String registerQueueConfigurationDataService = element.getAttribute("registerQueueConfigurationDataService");
        if (!FALSE.toString().equals(registerQueueConfigurationDataService)) {
            new BeanRegistrator(parserContext)
                .NAME("queueConfigurationDataService")
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 189..197
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 206..214
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 216..224
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 227..235
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 261..269
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 271..279
package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 281..289

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 47.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    public void waitForMessages() throws InterruptedException {
        if (logger.isDebugEnabled()) {
            logger.debug("In SynchronizationManager.waitForMessages()");
        }
worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SynchronizationManagerImpl.java on lines 91..102

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 47.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    public void cleanSuspendedExecutionsJob() {

        if (logger.isDebugEnabled()) {
            logger.debug("CleanSuspendedExecutionJob woke up at " + new Date());
engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java on lines 138..149

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 47.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    private boolean isNoModuleFoundIssue(Exception e) {
        if (e instanceof PyException) {
            PyException pyException = (PyException) e;
            String message = pyException.value.toString();
            return message.contains(noModuleNamedIssue);
runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/PythonExecutor.java on lines 128..135

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 46.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    private boolean isThreadsRelatedModuleIssue(Exception e) {
        if (e instanceof PyException) {
            PyException pyException = (PyException) e;
            String message = pyException.value.toString();
            return message.contains(THREADED_MODULES_ISSUE);
runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/EmbeddedPythonExecutorWrapper.java on lines 183..190

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 46.

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

    private Long pauseExecution(Execution execution, PauseReason pauseReason, boolean updateParentExecObject) {
        String branchId = execution.getSystemContext().getBranchId();

        // When flow termination type is canceled, it should not pause
        if ((execution.getSystemContext().getFlowTerminationType() != null) &&

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

    private void addFilePermissions(File file) throws IOException {
        Set<PosixFilePermission> filePermissions = new HashSet<>();
        filePermissions.add(PosixFilePermission.OWNER_READ);

        File[] fileChildren = file.listFiles();

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

    private boolean doStopPythonExecutorChildrenProcess(List<String> pythonExecutorChildrenPid, PythonExecutorProcessDetails pythonExecutorProcessDetails) {
        List<String> notRemovedPythonExecutorChildrenPid = new ArrayList<>();
        for (String pythonExecutorChildPid : pythonExecutorChildrenPid) {
            int pythonExecutorChildPIDValue = Integer.parseInt(pythonExecutorChildPid);
            JProcessesResponse killProcessGracefullyResponse = pythonExecutorProcessesService.killProcessGracefully(pythonExecutorChildPIDValue);

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

    private void addFilePermissions(File file) throws IOException {
        Set<PosixFilePermission> filePermissions = new HashSet<>();
        filePermissions.add(PosixFilePermission.OWNER_READ);

        File[] fileChildren = file.listFiles();

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

    private synchronized boolean doStartPythonExecutor() {
        if (!IS_PYTHON_EXECUTOR_EVAL) {
            return false;
        }

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

    private int countRetries(List<ExecutionMessage> msgs) {

        if (msgs.size() == 0) {
            return 0;
        }

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

    @Override
    public synchronized boolean stopPythonExecutorProcess(PythonExecutorProcessDetails pythonExecutorProcessDetails) {
        String pythonExecutorParentPid = pythonExecutorProcessDetails.getPythonExecutorParentPid();
        if (pythonExecutorParentPid == null) {
            List<String> pythonExecutorChildrenPid = pythonExecutorProcessDetails.getPythonExecutorChildrenPid();

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

Severity
Category
Status
Source
Language