ServiceInnovationLab/serviceinnovationlab.github.io

View on GitHub

Showing 134 of 135 total issues

Function doScroll has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

t.prototype.doScroll = function() {
var t,
e = this;
t = {
horizontal: {
Severity: Minor
Found in assets/js/waypoints.min.js - About 1 hr to fix

    Assignment Branch Condition size for create_presets is too high. [17.8/15]
    Open

    def create_presets(site)
    @use_tags = true
    @use_authors = true
    @use_categories = false
    @use_categories = true if site.config['related_categories']
    Severity: Minor
    Found in _plugins/related_posts.rb by rubocop

    Assignment Branch Condition size for find_published_authors is too high. [16.76/15]
    Open

    def find_published_authors
    published_authors = []
    @site_post_paths.each do |post_path|
    next unless File.exist? File.join(Dir.pwd, '_posts', post_path)
     
     
    Severity: Minor
    Found in _plugins/author_data.rb by rubocop

    Assignment Branch Condition size for weighted_sort is too high. [16.79/15]
    Open

    def weighted_sort(array, weight_name, sort_name)
    weighted_group = []
    az_group = []
    array.each do |item|
    if item[weight_name]
    Severity: Minor
    Found in _plugins/utility.rb by rubocop

    Method has too many lines. [11/10]
    Open

    def clip_char(str, char = '-')
    str = str.to_s
    str = if str[0] == char
    str[1...str.length]
    else
    Severity: Minor
    Found in _plugins/utility.rb by rubocop

    Cyclomatic complexity for matches_url is too high. [7/6]
    Open

    def matches_url(page_url, url)
    if url.is_a? Array
    urls = url.map do |u|
    page_url = clip_char(page_url.to_s.downcase, '/').split('/')[0]
    u = clip_char(u.to_s.downcase, '/').split('/')[0]
    Severity: Minor
    Found in _plugins/utility.rb by rubocop

    Perceived complexity for in_groups is too high. [8/7]
    Open

    def in_groups(number, fill_with = nil)
    # size.div number gives minor group size;
    # size % number gives how many objects need extra accommodation;
    # each group hold either division or division + 1 items.
    division = size.div number
    Severity: Minor
    Found in _plugins/utility.rb by rubocop

    Cyclomatic complexity for in_groups is too high. [7/6]
    Open

    def in_groups(number, fill_with = nil)
    # size.div number gives minor group size;
    # size % number gives how many objects need extra accommodation;
    # each group hold either division or division + 1 items.
    division = size.div number
    Severity: Minor
    Found in _plugins/utility.rb by rubocop

    Method has too many lines. [11/10]
    Open

    def update_file(author_path, key, value)
    frontmatter = File.read(author_path)[frontmatter_regex]
    frontmatter_yml = YAML.safe_load(frontmatter)
    if frontmatter_yml[key] != value
    frontmatter_yml[key] = value
    Severity: Minor
    Found in _plugins/author_data.rb by rubocop

    Perceived complexity for matches_url is too high. [8/7]
    Open

    def matches_url(page_url, url)
    if url.is_a? Array
    urls = url.map do |u|
    page_url = clip_char(page_url.to_s.downcase, '/').split('/')[0]
    u = clip_char(u.to_s.downcase, '/').split('/')[0]
    Severity: Minor
    Found in _plugins/utility.rb by rubocop

    Assignment Branch Condition size for tag_freq is too high. [15.81/15]
    Open

    def tag_freq(posts)
    @tag_freq = Hash.new(0)
    posts.docs.each do |post|
    post.data['categories'].each { |category| @tag_freq[category] += 1 } if @use_categories
    post.data['tags'].each { |tag| @tag_freq[tag] += 1 } if @use_tags
    Severity: Minor
    Found in _plugins/related_posts.rb by rubocop

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    right: function(t) {
    if (t == null) {
    t = r;
    }
    return h._filter(t, 'horizontal', function(t, e) {
    Severity: Major
    Found in assets/js/waypoints.min.js and 3 other locations - About 1 hr to fix
    assets/js/waypoints.min.js on lines 399..406
    assets/js/waypoints.min.js on lines 407..414
    assets/js/waypoints.min.js on lines 415..422

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    above: function(t) {
    if (t == null) {
    t = r;
    }
    return h._filter(t, 'vertical', function(t, e) {
    Severity: Major
    Found in assets/js/waypoints.min.js and 3 other locations - About 1 hr to fix
    assets/js/waypoints.min.js on lines 407..414
    assets/js/waypoints.min.js on lines 415..422
    assets/js/waypoints.min.js on lines 423..430

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    below: function(t) {
    if (t == null) {
    t = r;
    }
    return h._filter(t, 'vertical', function(t, e) {
    Severity: Major
    Found in assets/js/waypoints.min.js and 3 other locations - About 1 hr to fix
    assets/js/waypoints.min.js on lines 399..406
    assets/js/waypoints.min.js on lines 415..422
    assets/js/waypoints.min.js on lines 423..430

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    left: function(t) {
    if (t == null) {
    t = r;
    }
    return h._filter(t, 'horizontal', function(t, e) {
    Severity: Major
    Found in assets/js/waypoints.min.js and 3 other locations - About 1 hr to fix
    assets/js/waypoints.min.js on lines 399..406
    assets/js/waypoints.min.js on lines 407..414
    assets/js/waypoints.min.js on lines 423..430

    Block has too many lines. [38/25]
    Open

    describe 'class variables' do
    it "generates a list of 'published_authors'" do
    expect(@published_authors).to be_kind_of(Array)
    expect(@published_authors).not_to be_empty
    expect(@published_authors.size).to be > 0
    Severity: Minor
    Found in spec/_plugins/author_data_spec.rb by rubocop

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    function(direction) {
    $navItems.removeClass('nz-current', direction === 'up');
    if ($window.scrollTop() !== 0) {
    getRelatedNavigation(this).addClass(
    'nz-current',
    Severity: Major
    Found in assets/js/waypoints.js and 1 other location - About 1 hr to fix
    assets/js/waypoints.js on lines 21..29

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    function(direction) {
    $navItems.removeClass('nz-current', direction === 'down');
    if ($window.scrollTop() !== 0) {
    getRelatedNavigation(this).addClass(
    'nz-current',
    Severity: Major
    Found in assets/js/waypoints.js and 1 other location - About 1 hr to fix
    assets/js/waypoints.js on lines 37..45

    Function t has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function t(t) {
    var e = this;
    this.$element = t;
    this.element = t[0];
    this.didResize = false;
    Severity: Minor
    Found in assets/js/waypoints.min.js - About 1 hr to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      it 'can update and leave the content intact' do
      author_name = @author_data.fetch('author_with_content', 'name')
      expect(author_name).to eq 'burt'
       
      file_path = @author_data.create_file_path('author_with_content')
      Severity: Major
      Found in spec/_plugins/author_data_spec.rb and 1 other location - About 1 hr to fix
      spec/_plugins/author_data_spec.rb on lines 86..98
      Severity
      Category
      Status
      Source
      Language