Splunk SOAR

C901

chandraprathi
Explorer

While compiling and installing the Splunk phantom Application which I have developed, I am getting an error with error code: C901 and message: is too complex (33).

What I have made the mistake and how to fix the issue.

Labels (1)
Tags (2)
0 Karma
1 Solution

phanTom
SplunkTrust
SplunkTrust

This error is more of a style/best-practise error over functionality. Whenever you compile an app, phantom validates the function and style of the code. For example, It will complain if too many blank spaces/lines between functions etc. As you saw by moving code into a class it corrected the complaint. For just style errors you can use -d on the script to stop the style check.  

View solution in original post

0 Karma

phanTom
SplunkTrust
SplunkTrust

This error is more of a style/best-practise error over functionality. Whenever you compile an app, phantom validates the function and style of the code. For example, It will complain if too many blank spaces/lines between functions etc. As you saw by moving code into a class it corrected the complaint. For just style errors you can use -d on the script to stop the style check.  

0 Karma

chandraprathi
Explorer

Thank you for the solution. 

0 Karma

mattymo
Splunk Employee
Splunk Employee

Can you provide more detail about what exactly your app is doing?

Is this a phantom playbook you are building?

- MattyMo
0 Karma

chandraprathi
Explorer

I am developing an integration application. The error has gone off when I moved some part of the code as a function and calling the same. But not sure why it showing as error C901.

Did the framework allows only a limited number of lines of code in action as I have seen the same in the no.of characters in a single line?

0 Karma

mzambrana123
Explorer

Hello Chandra, 

I am not familiar with your specific error but I have encountered my set of issues with the Application Development portion. I believe this is an area that needs to be improved a bit more. That being said have you taken a look at the app development documentation. Breaking it down by section and maybe uncompiling one of the installed apps might give you an idea on what you are missing. 

0 Karma

chandraprathi
Explorer

I have gone through the app development documentation but no where I have found the info reg the error codes that are being encountered during development. It would be nice if there is the information reg the error codes or if it is there in the documentation I guess I missed it.

I have got rid of that error I faced when I moved a bunch of code into a different class.

0 Karma

mzambrana123
Explorer

Interesting! Which version of phantom are you running? Is it Python3 or 2? Did you move them to a pre staged class  from the application development template or did you create your own?

0 Karma

chandraprathi
Explorer

I'm using python3. I have moved it to the class which I have created on my own

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...