RocketChat/Rocket.Chat.Ops

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

Summary

Maintainability
Test Coverage

Line contains inconsistent indentation
Open

        if gitlabApiToken?

Line contains inconsistent indentation
Open

                    reply += pad("" + snippet.id , 8) + pad(snippet.author.name,20) + snippet.title + "\n"

Line contains inconsistent indentation
Open

                        break

Line contains inconsistent indentation
Open

        gitlab.projects.all  (projects) =>

Line contains inconsistent indentation
Open

                reply += pad("" + (idx + 1), 8) + pad(project.name, 20)  + project.created_at + "\n"

Line contains inconsistent indentation
Open

                    reply += pad("" + issue.iid , 8) + pad(issue.author.name,20) + issue.title + "\n"

Line contains inconsistent indentation
Open

                        break

Line contains inconsistent indentation
Open

        gitlab.projects.all  (projects) =>

Line contains inconsistent indentation
Open

    gitlabURL = process.env['GITLAB_URL']

Line contains inconsistent indentation
Open

                        break

Line contains inconsistent indentation
Open

                    reply += pad("Issue #" ,20) + issue.iid + "\n"

Line contains inconsistent indentation
Open

        gitlab.projects.all  (projects) =>

Line contains inconsistent indentation
Open

                    reply += pad("" + issue.iid , 8) + pad(issue.author.name,20) + issue.title + "\n"

Line contains inconsistent indentation
Open

        gitlab.projects.all  (projects) =>

Line contains inconsistent indentation
Open

                        break

Line contains inconsistent indentation
Open

        gitlab.projects.all  (projects) =>

Line contains inconsistent indentation
Open

        console.error("the environment variable GITLAB_URL must be set for hubot-gitsy to work properly")

Line contains inconsistent indentation
Open

                icon = ""

Line contains inconsistent indentation
Open

                reply = "```\n"

Line contains inconsistent indentation
Open

                icon = ""

Line contains inconsistent indentation
Open

                    reply += pad("Issue #",20) + issue.iid + "\n"

Line contains inconsistent indentation
Open

                        break

Line contains inconsistent indentation
Open

                reply = "```\n"

Line contains inconsistent indentation
Open

        gitlab.projects.all  (projects) ->

Line contains inconsistent indentation
Open

                reply = "```\n"

Line contains inconsistent indentation
Open

            console.error("the environment variable GITLAB_API_KEY must be set for hubot-gitsy to work properly")

Line contains inconsistent indentation
Open

        gitlab.projects.all  (projects) =>

Line contains inconsistent indentation
Open

                        desc = issue.description.split("\*\*Imported")[0]

Line contains inconsistent indentation
Open

                reply = "```\n"

Line contains tab indentation
Open

    gitlabApiToken = process.env['GITLAB_API_KEY']

Line contains tab indentation
Open

    if gitlabURL?

Line contains tab indentation
Open

            gitlab = gitlabaccess({'url': gitlabURL , 'token': gitlabApiToken })

Line contains tab indentation
Open

    # setup webhooks for incoming

Line exceeds maximum allowed length
Open

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

Line contains tab indentation
Open

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

Line contains tab indentation
Open

            for project, idx in projects

Line contains tab indentation
Open

                reply += pad("" + (idx + 1), 8) + pad(project.name, 20)  + project.created_at + "\n"

Unnecessary fat arrow
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

            gitlab.projects.issues.list  selproj.id,  {'iid': parseInt(res.match[1])},  (issues) ->

Line contains tab indentation
Open

                reply = "```\n"

Line contains tab indentation
Open

                reply += "```"

Line contains tab indentation
Open

                    if idx > limit

Line contains tab indentation
Open

                    # desc = issue.description.split("\*\*Imported")[0]

Line contains tab indentation
Open

                reply += "```"

Line exceeds maximum allowed length
Open

        console.error("the environment variable GITLAB_URL must be set for hubot-gitsy to work properly")

Line exceeds maximum allowed length
Open

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

Line contains tab indentation
Open

            reply += "snippets for n - list snippets for project #n\n"

Line contains tab indentation
Open

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

Line contains tab indentation
Open

                    if (issue.description.indexOf("**Imported") > -1)

Line contains tab indentation
Open

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

Line contains tab indentation
Open

            # console.log "PROJECT ID " + selproj.id

Line exceeds maximum allowed length
Open

            gitlab.projects.merge_requests.list  selproj.id,  {'iid': parseInt(res.match[1])},  (issues) ->

Line contains tab indentation
Open

    else

Line contains tab indentation
Open

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

Line contains tab indentation
Open

            # console.log "PROJECT ID " + selproj.id

Line contains tab indentation
Open

                    if idx > limit

Line contains tab indentation
Open

                reply = "```\n"

Line contains tab indentation
Open

    gitlabURL = process.env['GITLAB_URL']

Line contains tab indentation
Open

        if gitlabApiToken?

Line contains tab indentation
Open

            console.error("the environment variable GITLAB_API_KEY must be set for hubot-gitsy to work properly")

Line contains tab indentation
Open

        console.error("the environment variable GITLAB_URL must be set for hubot-gitsy to work properly")

Line contains tab indentation
Open

            reply += "You can add me for your own Gitlab CE projects or Gitlab cloud public projects.\n"

Line contains tab indentation
Open

                    reply += pad("" + issue.iid , 8) + pad(issue.author.name,20) + issue.title + "\n"

Line contains tab indentation
Open

                res.send reply

Line contains tab indentation
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

            gitlab.projects.merge_requests.list  selproj.id,  {'iid': parseInt(res.match[1])},  (issues) ->

Line contains tab indentation
Open

            # console.log "PROJECT ID " + selproj.id

Line contains tab indentation
Open

            gitlab.projects.listSnippets  {id: selproj.id},  (snippets) ->

Line contains tab indentation
Open

                for snippet, idx in snippets

Line contains tab indentation
Open

            selproj = projects[parseInt(res.match[2]) - 1]

Line contains tab indentation
Open

            snippetid = parseInt(res.match[1])

Line contains tab indentation
Open

            # console.log "PROJECT ID " + selproj.id

Line contains tab indentation
Open

                reply += "\n```"

Line contains tab indentation
Open

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

Line exceeds maximum allowed length
Open

                reply += pad("" + (idx + 1), 8) + pad(project.name, 20)  + project.created_at + "\n"

Line contains tab indentation
Open

                        desc = issue.description.split("\*\*Imported")[0]

Line contains tab indentation
Open

                    reply += "Body:\n"  + desc + "\n"

Line contains tab indentation
Open

            selproj = projects[parseInt(res.match[1]) - 1]

Line contains tab indentation
Open

                    if idx > limit

Line contains tab indentation
Open

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

Line contains tab indentation
Open

            selproj = projects[parseInt(res.match[1]) - 1]

Line contains tab indentation
Open

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

Line contains tab indentation
Open

            reply = "```\n"

Line exceeds maximum allowed length
Open

            gitlab.projects.issues.list  selproj.id,  {'iid': parseInt(res.match[1])},  (issues) ->

Line contains tab indentation
Open

                icon = ""

Line contains tab indentation
Open

                reply += "```"

Line contains tab indentation
Open

            selproj = projects[parseInt(res.match[1]) - 1]

Line contains tab indentation
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

                for issue, idx in issues

Line contains tab indentation
Open

    robot.respond  /projects/i, (res) ->

Line contains tab indentation
Open

                    if idx > limit

Line contains tab indentation
Open

        gitlab.projects.all  (projects) ->

Line contains tab indentation
Open

                res.send reply

Line contains tab indentation
Open

            reply += "```"

Line contains tab indentation
Open

                for issue, idx in issues

Line contains tab indentation
Open

                    reply += pad("Opened by" , 20) + issue.author.name + "\n"

Line contains tab indentation
Open

                    reply += pad("Title", 20) + issue.title + "\n"

Line contains tab indentation
Open

                res.send reply

Line contains tab indentation
Open

                        break

Unnecessary fat arrow
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

            gitlab.projects.merge_requests.list  selproj.id,  {'state': 'opened'},  (issues) ->

Line contains tab indentation
Open

                        break

Line contains tab indentation
Open

                        break

Line contains tab indentation
Open

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

Unnecessary fat arrow
Open

        gitlab.projects.all  (projects) =>

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

    gitlabwebhook(robot)

Line contains tab indentation
Open

                reply += "```"

Line contains tab indentation
Open

                icon = ""

Line contains tab indentation
Open

                    desc = issue.description

Line contains tab indentation
Open

            selproj = projects[parseInt(res.match[2]) - 1]

Line contains tab indentation
Open

                    icon = issue.author.avatar_url

Line contains tab indentation
Open

                reply = "```\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

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

            reply += "snippet n for m - view snippet #n for project #m\n"

Line exceeds maximum allowed length
Open

                    reply += pad("" + issue.iid , 8) + pad(issue.author.name,20) + issue.title + "\n"

Line contains tab indentation
Open

            res.send reply

Line contains tab indentation
Open

                    reply += pad("" + issue.iid , 8) + pad(issue.author.name,20) + issue.title + "\n"

Unnecessary fat arrow
Open

        gitlab.projects.all  (projects) =>

Line exceeds maximum allowed length
Open

                    reply += pad("" + issue.iid , 8) + pad(issue.author.name,20) + issue.title + "\n"

Line exceeds maximum allowed length
Open

            gitlab.projects.merge_requests.list  selproj.id,  {'state': 'opened'},  (issues) ->

Line contains tab indentation
Open

                        break

Line contains tab indentation
Open

                    reply += pad("Opened by" ,20) + issue.author.name + "\n"

Unnecessary fat arrow
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

                    desc = issue.description

Line contains tab indentation
Open

                    reply += "Body:\n"  + desc + "\n"

Line contains tab indentation
Open

                res.send reply

Line exceeds maximum allowed length
Open

                    reply += pad("" + snippet.id , 8) + pad(snippet.author.name,20) + snippet.title + "\n"

Line contains tab indentation
Open

                reply += "# ops:gitlabopencode\n#\n"

Line contains tab indentation
Open

                res.send reply

Line contains tab indentation
Open

    limit = 20

Line contains tab indentation
Open

            reply = ""

Line contains tab indentation
Open

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

Line contains tab indentation
Open

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

Line contains tab indentation
Open

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

Line exceeds maximum allowed length
Open

            console.error("the environment variable GITLAB_API_KEY must be set for hubot-gitsy to work properly")

Line contains tab indentation
Open

            reply += "projects - list all projects available\n"

Line contains tab indentation
Open

                for issue, idx in issues

Line contains tab indentation
Open

                for issue, idx in issues

Line contains tab indentation
Open

                reply = "```\n"

Line contains tab indentation
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

                    reply += pad("Issue #",20) + issue.iid + "\n"

Unnecessary fat arrow
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

                res.send reply

Line contains tab indentation
Open

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

Line contains tab indentation
Open

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

Line exceeds maximum allowed length
Open

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

Line contains tab indentation
Open

            res.send reply

Line contains tab indentation
Open

            # console.log "PROJECT ID " + selproj.id

Line contains tab indentation
Open

                reply = "```\n"

Line contains tab indentation
Open

                reply += "```"

Line contains tab indentation
Open

                        break

Line contains tab indentation
Open

            selproj = projects[parseInt(res.match[2]) - 1]

Line contains tab indentation
Open

                    reply += pad("Title", 20) + issue.title + "\n"

Line contains tab indentation
Open

                    if idx > limit

Line contains tab indentation
Open

            # console.log "PROJECT ID " + selproj.id

Line contains tab indentation
Open

                reply += rawcode.replace(/^\s*[\r\n]/gm, "")

Line contains tab indentation
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

        else

Line exceeds maximum allowed length
Open

            reply += "You can add me for your own Gitlab CE projects or Gitlab cloud public projects.\n"

Line contains tab indentation
Open

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

Line contains tab indentation
Open

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

Line exceeds maximum allowed length
Open

                # reply += "##{project.id}: #{project.name}, path: #{project.path}, default_branch: #{project.default_branch}, private: #{project.private}, owner: #{project.owner.name} (#{project.owner.email}), date: #{project.created_at}"

Line contains tab indentation
Open

            gitlab.projects.issues.list  selproj.id,  {'state': 'opened'},  (issues) ->

Line contains tab indentation
Open

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

Line contains tab indentation
Open

                    reply += pad("Issue #" ,20) + issue.iid + "\n"

Line contains tab indentation
Open

                    icon = issue.author.avatar_url

Line contains tab indentation
Open

        gitlab.projects.all  (projects) =>

Line contains tab indentation
Open

                    reply += pad("" + snippet.id , 8) + pad(snippet.author.name,20) + snippet.title + "\n"

Line contains tab indentation
Open

            gitlab.projects.getSnippet  {id: selproj.id, sid: snippetid},  (rawcode) ->

Line contains tab indentation
Open

                reply = "```\n"

There are no issues that match your filters.

Category
Status