RocketChat/Rocket.Chat.Ops

View on GitHub
hubots/hubot-baronbogo/src/hubot-baronbogo.coffee

Summary

Maintainability
Test Coverage

Line contains inconsistent indentation
Open

        console.error("the environment variable REPOSITORY_NAME must be specified for hubot-baronbogo to work properly")

Line contains inconsistent indentation
Open

        url = "https://api.github.com/users/" + res.match[2] + "/gists"

Line contains inconsistent indentation
Open

                        output = output + 'MORE ...\n'

Line contains inconsistent indentation
Open

                if pullreq

Line contains inconsistent indentation
Open

            issueText = "Pull Request"

Line contains inconsistent indentation
Open

        url = "https://api.github.com/repos/" + res.match[1] + "/issues?state=open"

Line contains inconsistent indentation
Open

                    output = output + pad( '' + g.number, 8)  + pad(g.user.login, 20) + '  '  + g.title + '\n'

Line contains inconsistent indentation
Open

            res.send disp_issues(issues, false)

Line contains inconsistent indentation
Open

        url = "https://api.github.com/repos/" + res.match[1] + "/issues?state=open"

Line contains inconsistent indentation
Open

        url = "https://api.github.com/repos/" + our_repo + "/issues?state=open"

Line contains inconsistent indentation
Open

            res.send disp_issue(issue)

Line contains inconsistent indentation
Open

            res.send disp_issues(issues, false)

Line contains inconsistent indentation
Open

            res.send disp_issue(issue)

Line contains inconsistent indentation
Open

        url = "https://api.github.com/users/" + res.match[1] + "/gists"

Line contains inconsistent indentation
Open

            github.get "https://api.github.com/gists/" + gists[parseInt(res.match[1]) - 1].id, (gist) ->

Line contains inconsistent indentation
Open

        output = '```\n'

Line contains inconsistent indentation
Open

            res.send disp_issues(issues, true)

Line contains inconsistent indentation
Open

        url = "https://api.github.com/repos/" + our_repo + "/issues/" + res.match[2]

Line contains inconsistent indentation
Open

                    continue

Line contains inconsistent indentation
Open

                    output = output + 'MORE ...\n'

Line contains inconsistent indentation
Open

            count = 1

Line contains inconsistent indentation
Open

    our_repo = process.env['REPOSITORY_NAME']

Line contains inconsistent indentation
Open

                if pullreq == true

Line contains inconsistent indentation
Open

            res.send disp_issues(issues, true)

Line contains inconsistent indentation
Open

        url = "https://api.github.com/repos/" + res.match[3] + '/issues/' + res.match[2]

Line contains inconsistent indentation
Open

                output = output + pad( '' + count, 8)  + g.description + '\n'

Line contains inconsistent indentation
Open

        issueText = "Issue"

Line contains inconsistent indentation
Open

            if g.pull_request?

Line contains inconsistent indentation
Open

        url = "https://api.github.com/repos/" +  our_repo + "/issues?state=open"

Line contains inconsistent indentation
Open

                    output = '```\n#ops:openeditor\n\n' + v.content + '\n```'

Line contains inconsistent indentation
Open

                for k,v of gist.files

Line contains tab indentation
Open

            res.send reply

Line contains tab indentation
Open

            res.send disp_issues(issues, false)

Line contains tab indentation
Open

    robot.respond /prs for (.*)/i, (res) ->

Line contains tab indentation
Open

    robot.respond /our (pr|issue) (.*)/i, (res) ->

Line contains tab indentation
Open

        url = "https://api.github.com/users/" + res.match[1] + "/gists"

Line contains tab indentation
Open

            count = 1

Line contains tab indentation
Open

    # handle gists

Line contains tab indentation
Open

        github.get url, (gists) ->

Line contains tab indentation
Open

        for g in issues

Line contains tab indentation
Open

        output = '```\n'

Line contains tab indentation
Open

        count = 0

Line contains tab indentation
Open

                    break

Line contains tab indentation
Open

                output = output + pad( '' + g.number, 8)  + pad(g.user.login, 20) + '  '  + g.title + '\n'

Line contains tab indentation
Open

                count++

Line contains tab indentation
Open

        #{issueText}: \##{issue.number}

Line contains tab indentation
Open

        """

Line contains tab indentation
Open

            #{issue.body}

Line contains tab indentation
Open

    robot.respond /our issues/i, (res) ->

Line exceeds maximum allowed length
Open

            reply += "I can do webhooks, issues, merge requests, and gists out of the box.\n"

Line contains tab indentation
Open

        url = "https://api.github.com/repos/" + our_repo + "/issues/" + res.match[2]

Line contains tab indentation
Open

            reply += "get gist n for m - view gist #n for user #m\n"

Line contains tab indentation
Open

    robot.respond /get gists for (.*)/i, (res) ->

Line contains tab indentation
Open

        url = "https://api.github.com/repos/" +  our_repo + "/issues?state=open"

Line contains tab indentation
Open

        github.get url, (gists) ->

Line contains tab indentation
Open

        github.get url, (issue) ->

Line contains tab indentation
Open

        console.error("the environment variable REPOSITORY_NAME must be specified for hubot-baronbogo to work properly")

Line contains tab indentation
Open

    # hook events handler

Line exceeds maximum allowed length
Open

                output = output + pad( '' + g.number, 8)  + pad(g.user.login, 20) + '  '  + g.title + '\n'

Line contains tab indentation
Open

        output = """

Line contains tab indentation
Open

            reply += "You can add me for your own public or private GitHub projects.\n"

Line contains tab indentation
Open

            reply += "pr n for m - show merge request #n  for project #m\n"

Line contains tab indentation
Open

                if pullreq == true

Line contains tab indentation
Open

            res.send disp_issues(issues, false)

Line contains tab indentation
Open

                    output = output + 'MORE ...\n'

Line exceeds maximum allowed length
Open

            reply += "Please add to my abilities and contribute your code to Rocket.Chat.\n"

Line contains tab indentation
Open

    robot.respond /our prs/i, (res) ->

Line contains tab indentation
Open

            reply += "our issues - list open issues for the project\n"

Line contains tab indentation
Open

        #  console.log 'url' + url

Line contains tab indentation
Open

            output = '```\n'

Line contains tab indentation
Open

                        break

Line contains tab indentation
Open

            for g in gists

Line contains tab indentation
Open

            else

Line contains tab indentation
Open

            output = output + '```'

Line contains tab indentation
Open

    disp_issue = (issue) ->

Line exceeds maximum allowed length
Open

            reply += "Hi, my name is baronbogo, and I am the Rocket.Chat GitHub integration bot.\n"

Line contains tab indentation
Open

            reply += "Find my code here:\n"

Line contains tab indentation
Open

        url = "https://api.github.com/repos/" + res.match[1] + "/issues?state=open"

Line contains tab indentation
Open

        github.get url, (issue) ->

Line contains tab indentation
Open

    our_repo = process.env['REPOSITORY_NAME']

Line contains tab indentation
Open

        output = output + '```'

Line contains tab indentation
Open

        return output

Line contains tab indentation
Open

    robot.respond  /intro baronbogo/i, (res) ->

Line contains tab indentation
Open

        url = "https://api.github.com/repos/" + res.match[3] + '/issues/' + res.match[2]

Line exceeds maximum allowed length
Open

    # console.log 'If you are curious, I am listening to  ' +  robot.listeners.length + ' source'

Line contains tab indentation
Open

                if count >= limit

Line contains tab indentation
Open

            reply += "https://github.com/RocketChat/Rocket.Chat.Ops/tree/master/hubots/hubot-baronbogo\n"

Line contains tab indentation
Open

            reply += "our prs - list open merge requests for the project\n"

Line contains tab indentation
Open

            reply += "our issue n - show issue n for the project\n"

Line contains tab indentation
Open

    robot.respond /issues for (.*)/i, (res) ->

Line contains tab indentation
Open

        github.get url, (issues) ->

Line contains tab indentation
Open

                output = output + pad( '' + count, 8)  + g.description + '\n'

Line contains tab indentation
Open

        url = "https://api.github.com/users/" + res.match[2] + "/gists"

Line contains tab indentation
Open

    github = githubot(robot)

Line contains tab indentation
Open

    disp_issues = (issues, pullreq) ->

Line contains tab indentation
Open

                if pullreq

Line contains tab indentation
Open

            reply += "Hi, my name is baronbogo, and I am the Rocket.Chat GitHub integration bot.\n"

Line contains tab indentation
Open

            reply += "issue n for m - show issue #n for project #m\n"

Line contains tab indentation
Open

        github.get url, (issues) ->

Line contains tab indentation
Open

        github.get url, (issues) ->

Line contains tab indentation
Open

            res.send disp_issue(issue)

Line contains tab indentation
Open

                count++

Line exceeds maximum allowed length
Open

        console.error("the environment variable REPOSITORY_NAME must be specified for hubot-baronbogo to work properly")

Line exceeds maximum allowed length
Open

                    output = output + pad( '' + g.number, 8)  + pad(g.user.login, 20) + '  '  + g.title + '\n'

Line contains tab indentation
Open

                    count++

Line contains tab indentation
Open

        Title: #{issue.title}

Line contains tab indentation
Open

        Status: #{issue.state}

Line contains tab indentation
Open

            reply += "gits for <userid> - list gists for specified GitHub user\n"

Line contains tab indentation
Open

        #  console.log 'url' + url

Line contains tab indentation
Open

    if !our_repo?

Line contains tab indentation
Open

            if g.pull_request?

Line contains tab indentation
Open

            reply = ""

Line contains tab indentation
Open

        url = "https://api.github.com/repos/" + our_repo + "/issues?state=open"

Line contains tab indentation
Open

        github.get url, (issues) ->

Line contains tab indentation
Open

            res.send disp_issues(issues, true)

Line contains tab indentation
Open

    githubevents(robot)

Line contains tab indentation
Open

        issueText = "Issue"

Line contains tab indentation
Open

            reply += "Please add to my abilities and contribute your code to Rocket.Chat.\n"

Line contains tab indentation
Open

        url = "https://api.github.com/repos/" + res.match[1] + "/issues?state=open"

Line exceeds maximum allowed length
Open

        url = "https://api.github.com/repos/" + res.match[3] + '/issues/' + res.match[2]

Line contains tab indentation
Open

                        output = output + 'MORE ...\n'

Line contains tab indentation
Open

        if issue.pull_request?

Line contains tab indentation
Open

        return output

Line contains tab indentation
Open

    robot.respond /(pr|issue) (.*) for (.*)/i, (res) ->

Line contains tab indentation
Open

                    continue

Line contains tab indentation
Open

            issueText = "Pull Request"

Line contains tab indentation
Open

        Url: #{issue.html_url}

Line contains tab indentation
Open

            res.send disp_issue(issue)

Line contains tab indentation
Open

            res.send output

Line contains tab indentation
Open

    limit = 20

Line contains tab indentation
Open

                    output = output + pad( '' + g.number, 8)  + pad(g.user.login, 20) + '  '  + g.title + '\n'

Line contains tab indentation
Open

        Opened by: #{issue.user.login}

Line exceeds maximum allowed length
Open

            reply += "https://github.com/RocketChat/Rocket.Chat.Ops/tree/master/hubots/hubot-baronbogo\n"

Line contains tab indentation
Open

            res.send disp_issues(issues, true)

Line contains tab indentation
Open

    robot.respond /get gist (.*) for (.*)/i, (res) ->

Line contains tab indentation
Open

                    if (count >= limit)

Line contains tab indentation
Open

            reply += "I can do webhooks, issues, merge requests, and gists out of the box.\n"

Line contains tab indentation
Open

                    res.send output

Line contains tab indentation
Open

                    output = '```\n#ops:openeditor\n\n' + v.content + '\n```'

Line exceeds maximum allowed length
Open

            github.get "https://api.github.com/gists/" + gists[parseInt(res.match[1]) - 1].id, (gist) ->

Line contains tab indentation
Open

                for k,v of gist.files

Line contains tab indentation
Open

            github.get "https://api.github.com/gists/" + gists[parseInt(res.match[1]) - 1].id, (gist) ->

There are no issues that match your filters.

Category
Status