Showing 56 of 95 total issues
File search-api.js
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable camelcase */
import Promise from 'bluebird';
import LRU from 'lru-cache';
import es from './es-client';
File converter.rb
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'time'
require 'set'
require 'hashie/mash'
require 'hdo/storting_importer'
require 'childprocess'
Function render
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
scoreStats,
parties,
timeline,
Function getLixStats
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLixStats() {
return es
.search({
index: INDEX_NAME,
type: INDEX_TYPE,
Method parse_name_string
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse_name_string(str, person)
result = Hashie::Mash.new
orig = str
str = clean_name_string(str)
- Read upRead up
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 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let speech = this.props.speech;
let timestamp = TimeUtils.timestampForHit(speech);
let title = speech.title;
Method parse_name_string
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def parse_name_string(str, person)
result = Hashie::Mash.new
orig = str
str = clean_name_string(str)
Class Converter
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Converter
class << self
def parse(file, options = {})
case file
when /s(\d{2})(\d{2})(\d{2}).*\.xml$/i
Function render
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let unit = this.props.unit;
let counts = this.props.counts;
if (this.props.sort) {
Function _buildAggregationsQuery
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_buildAggregationsQuery(opts) {
var query = this._queryFor(opts.query);
var aggregations = {
timeline: {
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
if (this.state.queries.length) {
this.chartOptions.axisY.onlyInteger = this.props.unit === 'count';
return (
File hdo-transcript-indexer.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'nokogiri'
require 'pathname'
require 'uri'
require 'logger'
require 'json'
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let result = this.getFocusedHitSet();
if (!result) {
return null;
Function renderPeopleStats
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderPeopleStats() {
let people = this.state.people[this.props.unit] || [];
let isPct = this.props.unit === 'pct';
people = people.slice(0, 8);
Function createFeed
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function createFeed(opts) {
let { baseUrl, imageUrl, absoluteUrl, results, query } = opts;
let links = {};
let start = +(query.start || 0);
Function render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let speeches = this.props.speeches;
if (!speeches.length) {
return null;
Function _setupAnimation
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setupAnimation() {
//
// http://gionkunz.github.io/chartist-js/examples.html#advanced-smil-animations
//
Method parse_speech
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse_speech(node)
name_nodes = node.css('navn, Navn')
name_str = name_nodes.text
text = clean_text(text_from(node))
- Read upRead up
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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<footer>
<a href="https://www.holderdeord.no/">
<img className="logo" src="/logo.png" />
Function getHitStream
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getHitStream(opts) {
let delimiter = opts.format === 'csv' ? ',' : '\t';
let scrollId = null;
let tsvHeaders = TSV_HEADERS;
if (opts.extra_fields) {