rastating/xss-chef

View on GitHub

Showing 17 of 26 total issues

Function compile has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  compile () {
    if (!this.props.cookBook) {
      return ''
    }

Severity: Minor
Found in components/PayloadPanel/PayloadPanel.jsx - About 2 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

Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function render (instance, setRecipeProperty) {
  return (
    <div>
      <div className="float-left mr-3 form-group form-check">
        <input
Severity: Minor
Found in recipes/DecimalEncoder/DecimalEncoder.jsx - About 1 hr to fix

    Function render has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function render (instance, setRecipeProperty) {
      return (
        <div>
          <RecipeTextField
            bindTo="username"
    Severity: Minor
    Found in recipes/WordPressCreateUser/WordPressCreateUser.jsx - About 1 hr to fix

      Function compile has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        compile () {
          if (!this.props.cookBook) {
            return ''
          }
      
      
      Severity: Minor
      Found in components/PayloadPanel/PayloadPanel.jsx - About 1 hr to fix

        Function render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function render (instance, setRecipeProperty) {
          return (
            <div>
              <RecipeTextField
                bindTo="callbackUrl"
        Severity: Minor
        Found in recipes/CookieExfiltrator/CookieExfiltrator.jsx - About 1 hr to fix

          Function cook has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function cook (instance, vars) {
            const url = buildUrl(['/', instance.adminPath, 'user-new.php'])
            const nonceCallback = `${instance.id}_createUser`
            const username = instance.username.replace(/\\/, '\\\\').replace(/'/g, "\\'")
            const password = instance.password.replace(/\\/, '\\\\').replace(/'/g, "\\'")
          Severity: Minor
          Found in recipes/WordPressCreateUser/WordPressCreateUser.jsx - About 1 hr to fix

            Function cook has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function cook (instance, vars) {
              let cookieSelection = 'var c = document.cookie'
            
              if (instance.cookie) {
                cookieSelection = `var c = document.cookie.match(new RegExp('(^| )${instance.cookie}=([^;]+)'));)[2]`
            Severity: Minor
            Found in recipes/CookieExfiltrator/CookieExfiltrator.jsx - About 1 hr to fix

              Function cookBook has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const cookBook = (previousState = initialState, action) => {
                let state = Object.assign([], previousState)
                let payload = action.payload
              
                switch (action.type) {
              Severity: Minor
              Found in reducers/CookBook/CookBook.jsx - About 1 hr to fix

                Function cookBook has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                const cookBook = (previousState = initialState, action) => {
                  let state = Object.assign([], previousState)
                  let payload = action.payload
                
                  switch (action.type) {
                Severity: Minor
                Found in reducers/CookBook/CookBook.jsx - About 1 hr 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

                Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function render (instance, setRecipeProperty) {
                  return (
                    <div>
                      <RecipeTextField
                        bindTo="resource"
                Severity: Minor
                Found in recipes/StringExfiltrator/StringExfiltrator.jsx - About 1 hr to fix

                  Function render has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render () {
                      let item = this.loadItem()
                      let recipe = item.recipe
                      let instance = item.instance
                      let isValid = recipe && recipe.validate(instance)
                  Severity: Minor
                  Found in components/CookBookItem/CookBookItem.jsx - About 1 hr to fix

                    Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render () {
                        let payload = beautify(this.compile(), {
                          indent_size: 2,
                          space_after_anon_function: true,
                          space_after_named_function: true
                    Severity: Minor
                    Found in components/PayloadPanel/PayloadPanel.jsx - About 1 hr to fix

                      Function cook has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function cook (instance, vars) {
                        let payload = vars.payload.replace(/\n?__XSS_CHEF_.+?__/g, '')
                        let encoded = ''
                      
                        for (var i = 0; i < payload.length; i++) {
                      Severity: Minor
                      Found in recipes/DecimalEncoder/DecimalEncoder.jsx - 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

                      Avoid too many return statements within this function.
                      Open

                          return false
                      Severity: Major
                      Found in recipes/WordPressCreateUser/WordPressCreateUser.jsx - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return true
                        Severity: Major
                        Found in recipes/WordPressCreateUser/WordPressCreateUser.jsx - About 30 mins to fix

                          Function cook has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function cook (instance, vars) {
                            let cookieSelection = 'var c = document.cookie'
                          
                            if (instance.cookie) {
                              cookieSelection = `var c = document.cookie.match(new RegExp('(^| )${instance.cookie}=([^;]+)'));)[2]`
                          Severity: Minor
                          Found in recipes/CookieExfiltrator/CookieExfiltrator.jsx - About 25 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

                          Function validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function validate (instance) {
                            if (!instance.username.match(/^.{4,}$/)) {
                              return false
                            }
                          
                          
                          Severity: Minor
                          Found in recipes/WordPressCreateUser/WordPressCreateUser.jsx - About 25 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

                          Severity
                          Category
                          Status
                          Source
                          Language