razum2um/lurker

View on GitHub

Showing 330 of 330 total issues

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

            if (existingPropNames[propType].hasOwnProperty(key.name)) {
                isValidDuplicateProp =
                    // There isn't already a setter for this prop
                    existingPropNames[propType][key.name].set === undefined
                    // There isn't already a data prop by this name
Severity: Major
Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 6 hrs to fix
lib/lurker/templates/javascripts/JSXTransformer.js on lines 6112..6125

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 156.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function 5 has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],5:[function(_dereq_,module,exports){
(function (process){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
Severity: Major
Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 5 hrs to fix

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

                if (match('[')) {
                    expr = delegate.createMemberExpression('[', expr, parseComputedMember());
                    marker.end();
                    marker.apply(expr);
                } else if (match('.')) {
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 5 hrs to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 7348..7360

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 149.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

                } else if (match('[')) {
                    expr = delegate.createMemberExpression('[', expr, parseComputedMember());
                    marker.end();
                    marker.apply(expr);
                } else if (match('.')) {
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 5 hrs to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 7316..7328

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 149.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function _readInt32 (buf, offset, littleEndian, noAssert) {
      if (!noAssert) {
        assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
        assert(offset !== undefined && offset !== null, 'missing offset')
        assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 5 hrs to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 591..608

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 145.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function _readInt16 (buf, offset, littleEndian, noAssert) {
      if (!noAssert) {
        assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
        assert(offset !== undefined && offset !== null, 'missing offset')
        assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 5 hrs to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 618..635

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 145.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function _writeFloat (buf, value, offset, littleEndian, noAssert) {
      if (!noAssert) {
        assert(value !== undefined && value !== null, 'missing value')
        assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
        assert(offset !== undefined && offset !== null, 'missing offset')
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 5 hrs to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 842..857

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 143.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function _writeDouble (buf, value, offset, littleEndian, noAssert) {
      if (!noAssert) {
        assert(value !== undefined && value !== null, 'missing value')
        assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
        assert(offset !== undefined && offset !== null, 'missing offset')
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 5 hrs to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 818..832

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 143.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function 16 has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"./source-map-generator":14,"./util":16,"amdefine":17}],16:[function(_dereq_,module,exports){
    /* -*- Mode: js; js-indent-level: 2; -*- */
    /*
     * Copyright 2011 Mozilla Foundation and contributors
     * Licensed under the New BSD license. See LICENSE or:
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 5 hrs to fix

      Method resource has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

              def resource(*resources, &block)
                options = resources.extract_options!.dup
      
                if apply_common_behavior_for(:resource, resources, options, &block)
                  return self
      Severity: Minor
      Found in templates/rails32_http_patch_support.rb - About 5 hrs to fix

      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 26 has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"../src/utils":20,"esprima-fb":6}],26:[function(_dereq_,module,exports){
      /**
       * Copyright 2013-2014 Facebook, Inc.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
      Severity: Major
      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 5 hrs to fix

        Function patch has 129 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function patch() {
        
                var wrapTracking, wrapTrackingPreserveWhitespace;
        
                if (extra.comments) {
        Severity: Major
        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 5 hrs to fix

          Function 27 has 127 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"./fbtransform/visitors":30,"buffer":1,"jstransform":19,"jstransform/src/docblock":18}],27:[function(_dereq_,module,exports){
          /**
           * Copyright 2013-2014 Facebook, Inc.
           *
           * Licensed under the Apache License, Version 2.0 (the "License");
          Severity: Major
          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 5 hrs to fix

            Function scanComment has 116 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function scanComment() {
                    var comment, ch, loc, start, blockComment, lineComment;
            
                    comment = '';
                    blockComment = false;
            Severity: Major
            Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 4 hrs to fix

              Function scanTemplate has 108 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function scanTemplate() {
                      var cooked = '', ch, start, terminated, tail, restore, unescaped, code, octal;
              
                      terminated = false;
                      tail = false;
              Severity: Major
              Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 4 hrs to fix

                File generate_stuff.rb has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                if rails_version = ENV['BUNDLE_GEMFILE'].to_s.match(/rails_\d\d/)
                  base_db_name = "lurker_app_#{rails_version}"
                else
                  base_db_name = 'lurker_app'
                end
                Severity: Minor
                Found in templates/generate_stuff.rb - About 4 hrs to fix

                  Function visitReactTag has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function visitReactTag(traverse, object, path, state) {
                    var jsxObjIdent = utils.getDocblock(state).jsx;
                    var openingElement = object.openingElement;
                    var nameObject = openingElement.name;
                    var attributesObject = openingElement.attributes;
                  Severity: Major
                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 4 hrs to fix

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

                                if (extra.loc) {
                                    node.groupLoc = {
                                        start: {
                                            line: this.loc.start.line,
                                            column: this.loc.start.column
                    Severity: Major
                    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 4 hrs to fix
                    lib/lurker/templates/javascripts/JSXTransformer.js on lines 7270..7282

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 118.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                                if (extra.loc) {
                                    node.loc = {
                                        start: {
                                            line: this.loc.start.line,
                                            column: this.loc.start.column
                    Severity: Major
                    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 4 hrs to fix
                    lib/lurker/templates/javascripts/JSXTransformer.js on lines 7246..7258

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 118.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Function scanStringLiteral has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function scanStringLiteral() {
                            var str = '', quote, start, ch, code, unescaped, restore, octal = false;
                    
                            quote = source[index];
                            assert((quote === '\'' || quote === '"'),
                    Severity: Major
                    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language