Get bugs that match this line in the Bug Suggestions artifact for this job.
3648
def unstructured_bugs(self):
        
        components = self._serialized_components()
        if not components:
            return []

        from treeherder.model.error_summary import get_useful_search_results
        job = Job.objects.get(guid=self.job_guid)
        rv = []
        ids_seen = set()
        for item in get_useful_search_results(job):
            if all(component in item["search"] for component in components):
                for suggestion in itertools.chain(item["bugs"]["open_recent"],
                                                  item["bugs"]["all_others"]):
                    if suggestion["id"] not in ids_seen:
                        ids_seen.add(suggestion["id"])
                        rv.append(suggestion)

        return rv
87852
public void getNewLines() {
        try {
            List<MonitorLine> lines;
            if (getAll()) {
                lines = getSource().getLinesFrom(null);
            } else {
                lines = getSource().getLinesFrom(actual);
            }
            updateLines(lines);
        } catch (Exception e) {
            notifyObservers(e);
        }
    }
397834
private void reportBugs() {
        Iterator<Map.Entry<Integer, Map<JavaClass, List<MethodInfo>>>> it = parameterDefiners.entrySet().iterator();
        while (it.hasNext()) {
            try {
                Map.Entry<Integer, Map<JavaClass, List<MethodInfo>>> entry = it.next();

                Integer reg = entry.getKey();
                if (!usedParameters.get(reg.intValue())) {
                    it.remove();
                    continue;
                }
                Map<JavaClass, List<MethodInfo>> definers = entry.getValue();
                definers.remove(objectClass);
                if (definers.size() > 1) {
                    removeInheritedInterfaces(definers);
                }

                if ((definers.size() == 1) && !hasOverloadedMethod()) {

                    String name = "";
                    LocalVariableTable lvt = getMethod().getLocalVariableTable();
                    if (lvt != null) {
                        LocalVariable lv = lvt.getLocalVariable(reg.intValue(), 0);
                        if (lv != null) {
                            name = lv.getName();
                        }
                    }
                    int parm = reg.intValue();
                    if (!methodIsStatic) {
                        parm--;
                    }

                    parm++; // users expect 1 based parameters

                    String infName = definers.keySet().iterator().next().getClassName();
                    bugReporter.reportBug(
                            new BugInstance(this, BugType.OCP_OVERLY_CONCRETE_PARAMETER.name(), NORMAL_PRIORITY)
                                    .addClass(this).addMethod(this).addSourceLine(this, 0)
                                    .addString(getCardinality(parm) + " parameter '" + name + "' could be declared as "
                                            + infName + " instead"));
                }
            } catch (ClassNotFoundException e) {
                bugReporter.reportMissingClass(e);
            }
        }
    }
305276
def violation_lines(self, src_path):
        

        diff_violations = self._diff_violations().get(src_path)

        if diff_violations is None:
            return []

        return sorted(diff_violations.lines)
563204
def getbugs(self, idlist,
                include_fields=None, exclude_fields=None, extra_fields=None,
                permissive=True):
        
        data = self._getbugs(idlist, include_fields=include_fields,
            exclude_fields=exclude_fields, extra_fields=extra_fields,
            permissive=permissive)
        return [(b and Bug(self, dict=b,
                           autorefresh=self.bug_autorefresh)) or None
                for b in data]
238487
def find_diff_violations(self, patch):
        
        violations = collections.defaultdict(list)
        for line in patch.changed_lines:
            file_violations = self._all_violations.get(line['file_name'])
            if not file_violations:
                continue

            line_violations = [v for v in file_violations if v.line == line['line_number']]

            for v in line_violations:
                violations[line['file_name']].append(v)

        return violations
240981
def get_bug_simple(self, bugid):
        
        payload = {'ids': bugid}
        d = self.call('Bug.get', payload)
        d.addCallback(self._parse_bug_callback)
        return d
734898
def extract_text_log_artifacts(job_log):
    """"""

    # parse a log given its url
    artifact_bc = ArtifactBuilderCollection(job_log.url)
    artifact_bc.parse()

    artifact_list = []
    for name, artifact in artifact_bc.artifacts.items():
        artifact_list.append({
            "job_guid": job_log.job.guid,
            "name": name,
            "type": 'json',
            "blob": json.dumps(artifact)
        })

    return artifact_list
1251065
def _apply_line_rules(lines, commit, rules, line_nr_start):
        
        all_violations = []
        line_nr = line_nr_start
        for line in lines:
            for rule in rules:
                violations = rule.validate(line, commit)
                if violations:
                    for violation in violations:
                        violation.line_nr = line_nr
                        all_violations.append(violation)
            line_nr += 1
        return all_violations
1242363
def get_bug_report():
        
        platform_info = BugReporter.get_platform_info()
        module_info = {
            'version': hal_version.__version__,
            'build': hal_version.__build__
        }

        return {
            'platform': platform_info,
            'pyhal': module_info
        }
1333041
private Set<String> buildClassSet(BugCollection bugCollection) {
        Set<String> classSet = new HashSet<>();

        for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) {
            BugInstance warning = i.next();
            for (Iterator<BugAnnotation> j = warning.annotationIterator(); j.hasNext();) {
                BugAnnotation annotation = j.next();
                if (!(annotation instanceof ClassAnnotation)) {
                    continue;
                }
                classSet.add(((ClassAnnotation) annotation).getClassName());
            }
        }

        return classSet;
    }
628708
def search_bugs(self, terms):
        ''''''
        params = ''
        for i in terms:
            k = i.popitem()
            params = '{p}&{new}={value}'.format(p=params, new=quote_url(k[0]),
                        value=quote_url(k[1]))
        return DotDict(self._get('bug', params=params))
1039954
def branches_containing(commit):
    """"""
    lines = run('branch --contains %s' % commit).splitlines()
    return [l.lstrip('* ') for l in lines]
543273
void checkDependencies()
            throws MojoExecutionException
    {
        if ( dependencies == null )
        {
            return;
        }

        boolean failed = false;

        Collection<Artifact> artifacts = getProject().getArtifacts();

        getLog().debug( "artifacts: " + artifacts.size() );

        if ( dependencies.getIncludes() != null && !dependencies.getIncludes().isEmpty() )
        {
            failed = checkDependencies( dependencies.getIncludes(), artifacts );
        }
        if ( dependencies.getExcludes() != null && !dependencies.getExcludes().isEmpty() )
        {
            failed = checkDependencies( dependencies.getExcludes(), artifacts ) || failed;
        }

        if ( failed )
        {
            throw new MojoExecutionException(
                    "At least one specified dependency is incorrect. Review your project configuration." );
        }
    }
523031
def check_other(self):
        
        if self.reqs:
            self.stdout.write(self.style.ERROR("\nOnly pypi and github based requirements are supported:"))
            for name, req in self.reqs.items():
                if "dist" in req:
                    pkg_info = "{dist.project_name} {dist.version}".format(dist=req["dist"])
                elif "url" in req:
                    pkg_info = "{url}".format(url=req["url"])
                else:
                    pkg_info = "unknown package"
                self.stdout.write(self.style.BOLD("{pkg_info:40} is not a pypi or github requirement".format(pkg_info=pkg_info)))
692053
private void reportBugs() {
        for (Map.Entry<QMethod, String> attEntry : attributes.entrySet()) {
            QMethod methodInfo = attEntry.getKey();
            String attType = attEntry.getValue();

            Map<Map.Entry<String, String>, SourceLineAnnotation> fields = methodWrites.get(methodInfo);
            if ((fields == null) || (fields.size() != 1)) {
                continue;
            }

            Map.Entry<String, String> fieldInfo = fields.keySet().iterator().next();
            String fieldType = fieldInfo.getValue();

            if (!attType.equals(fieldType)) {
                continue;
            }

            String fieldName = fieldInfo.getKey();

            for (Map.Entry<QMethod, Map<Map.Entry<String, String>, SourceLineAnnotation>> fwEntry : methodWrites.entrySet()) {
                if (fwEntry.getKey().equals(methodInfo)) {
                    continue;
                }

                SourceLineAnnotation sla = fwEntry.getValue().get(fieldInfo);
                if (sla != null) {
                    bugReporter.reportBug(new BugInstance(this, BugType.NRTL_NON_RECYCLEABLE_TAG_LIB.name(), NORMAL_PRIORITY).addClass(this)
                            .addField(fieldAnnotations.get(fieldName)).addSourceLine(sla));
                    break;
                }
            }
        }
    }
1138636
def search(self, query, options):
        
        query["query_format"] = "advanced"
        log.debug("Search query:")
        log.debug(pretty(query))
        # Fetch bug info
        try:
            result = self.server.query(query)
        except xmlrpclib.Fault as error:
            # Ignore non-existent users (this is necessary for users with
            # several email aliases to allow them using --merge/--total)
            if "not a valid username" in unicode(error):
                log.debug(error)
                return []
            # Otherwise suggest to bake bugzilla cookies
            log.error("An error encountered, while searching for bugs.")
            log.debug(error)
            raise ReportError(
                "Have you baked cookies using the 'bugzilla login' command?")
        log.debug("Search result:")
        log.debug(pretty(result))
        bugs = dict((bug.id, bug) for bug in result)
        # Fetch bug history
        log.debug("Fetching bug history")
        result = self.server._proxy.Bug.history({'ids': bugs.keys()})
        log.debug(pretty(result))
        history = dict((bug["id"], bug["history"]) for bug in result["bugs"])
        # Fetch bug comments
        log.debug("Fetching bug comments")
        result = self.server._proxy.Bug.comments({'ids': bugs.keys()})
        log.debug(pretty(result))
        comments = dict(
            (int(bug), data["comments"])
            for bug, data in result["bugs"].items())
        # Create bug objects
        return [
            self.parent.bug(
                bugs[id], history[id], comments[id], parent=self.parent)
            for id in bugs]