Splunk SOAR (f.k.a. Phantom)

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
Get Updates on the Splunk Community!

Optimize Cloud Monitoring

  TECH TALKS Optimize Cloud Monitoring Tuesday, August 13, 2024  |  11:00AM–12:00PM PST   Register to ...

What's New in Splunk Cloud Platform 9.2.2403?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2403! Analysts can ...

Stay Connected: Your Guide to July and August Tech Talks, Office Hours, and Webinars!

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...