jonniespratley/angular-cms

View on GitHub

Showing 73 of 73 total issues

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

    var delay = function (fn, time) {
        var defer = q.defer();
        setTimeout(function () {
            fn();
            defer.resolve();
Severity: Major
Found in routes/cms-sockets.js and 1 other location - About 1 hr to fix
routes/socketserver.js on lines 23..30

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 63.

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

module.exports = function (config) {
    'use strict';
    config.set({
        // base path, that will be used to resolve files and exclude
        basePath: '.',
Severity: Minor
Found in karma.conf.js - About 1 hr to fix

    Function uploadFile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            return this.uploadFile = function(file) {
              var form, transferCanceled, transferComplete, transferFailed, updateProgress, xhr;
              form = new FormData();
              form.append('files[]', file);
              xhr = new XMLHttpRequest();
    Severity: Minor
    Found in app/scripts/directives/cms-uploader.js - About 1 hr to fix

      Function cmsAuth has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      var cmsAuth = function(config, app) {
          console.warn('cms-auth initialized');
      
          //### hashPassword
          //Hash password using basic sha1 hash.
      Severity: Minor
      Found in routes/cms-auth.js - About 1 hr 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 strong_em has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function strong_em( tag, md ) {
      
        var state_slot = tag + "_state",
            other_slot = tag == "strong" ? "em_state" : "strong_state";
      
      
      Severity: Minor
      Found in app/libs/markdown.js - About 1 hr to fix

        Function block_meta has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Markdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {
          // check if the last line of the block is an meta hash
          var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ );
          if ( !m ) return undefined;
        
        
        Severity: Minor
        Found in app/libs/markdown.js - About 1 hr to fix

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

              var WebSocketClient = function (options) {
                  var _ws = new WebSocket(options.endpoint, options.protocol);
                  _ws.onmessage = function (e) {
                      $rootScope.$emit(options.protocol, e);
                      return console.log(e.data);
          Severity: Minor
          Found in app/scripts/services/cms-socketservice.js - About 1 hr to fix

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

                function II(a, b, c, d, x, s, ac) {
                    a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
                    return AddUnsigned(RotateLeft(a, s), b);
                }
            Severity: Major
            Found in app/libs/md5.js and 3 other locations - About 1 hr to fix
            app/libs/md5.js on lines 45..48
            app/libs/md5.js on lines 51..54
            app/libs/md5.js on lines 57..60

            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 56.

            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 4 locations. Consider refactoring.
            Open

                function FF(a, b, c, d, x, s, ac) {
                    a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
                    return AddUnsigned(RotateLeft(a, s), b);
                }
            Severity: Major
            Found in app/libs/md5.js and 3 other locations - About 1 hr to fix
            app/libs/md5.js on lines 51..54
            app/libs/md5.js on lines 57..60
            app/libs/md5.js on lines 63..66

            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 56.

            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 4 locations. Consider refactoring.
            Open

                function GG(a, b, c, d, x, s, ac) {
                    a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
                    return AddUnsigned(RotateLeft(a, s), b);
                }
            Severity: Major
            Found in app/libs/md5.js and 3 other locations - About 1 hr to fix
            app/libs/md5.js on lines 45..48
            app/libs/md5.js on lines 57..60
            app/libs/md5.js on lines 63..66

            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 56.

            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 4 locations. Consider refactoring.
            Open

                function HH(a, b, c, d, x, s, ac) {
                    a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
                    return AddUnsigned(RotateLeft(a, s), b);
                }
            Severity: Major
            Found in app/libs/md5.js and 3 other locations - About 1 hr to fix
            app/libs/md5.js on lines 45..48
            app/libs/md5.js on lines 51..54
            app/libs/md5.js on lines 63..66

            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 56.

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

            function split_meta_hash( meta_string ) {
              var meta = meta_string.split( "" ),
                  parts = [ "" ],
                  in_quotes = false;
            
            
            Severity: Minor
            Found in app/libs/markdown.js - About 1 hr to fix

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

              angular.module('angularCmsApp').factory('cmsDataServiceFactory', function() {
                var meaningOfLife;
                meaningOfLife = 42;
                return {
                  someMethod: function() {
              Severity: Minor
              Found in app/scripts/services/cms-dataservicefactory.js and 1 other location - About 55 mins to fix
              app/scripts/services/cms-usersfactory.js on lines 11..19

              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 54.

              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 5 locations. Consider refactoring.
              Open

              task :deploy_d => :build do
                require 'net/ssh'
                require 'net/scp'
              
                server = 'jonniespratley.me'
              Severity: Major
              Found in Rakefile.rb and 4 other locations - About 55 mins to fix
              Rakefile.rb on lines 38..48
              Rakefile.rb on lines 55..64
              Rakefile.rb on lines 72..81
              Rakefile.rb on lines 88..98

              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 46.

              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 5 locations. Consider refactoring.
              Open

              task :deploy => :build do
                require 'net/ssh'
                require 'net/scp'
              
                server = 'jonniespratley.me'
              Severity: Major
              Found in Rakefile.rb and 4 other locations - About 55 mins to fix
              Rakefile.rb on lines 20..29
              Rakefile.rb on lines 38..48
              Rakefile.rb on lines 72..81
              Rakefile.rb on lines 88..98

              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 46.

              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 5 locations. Consider refactoring.
              Open

              task :deploy_scripts => :build do
                require 'net/ssh'
                require 'net/scp'
              
                server = 'jonniespratley.me'
              Severity: Major
              Found in Rakefile.rb and 4 other locations - About 55 mins to fix
              Rakefile.rb on lines 20..29
              Rakefile.rb on lines 38..48
              Rakefile.rb on lines 55..64
              Rakefile.rb on lines 88..98

              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 46.

              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

              angular.module('angularCmsApp').factory('cmsUsersFactory', function() {
                var meaningOfLife;
                meaningOfLife = 42;
                return {
                  someMethod: function() {
              Severity: Minor
              Found in app/scripts/services/cms-usersfactory.js and 1 other location - About 55 mins to fix
              app/scripts/services/cms-dataservicefactory.js on lines 2..10

              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 54.

              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 5 locations. Consider refactoring.
              Open

              task :deploy_t => :build do
                require 'net/ssh'
                require 'net/scp'
              
                server = 'jonniespratley.me'
              Severity: Major
              Found in Rakefile.rb and 4 other locations - About 55 mins to fix
              Rakefile.rb on lines 20..29
              Rakefile.rb on lines 55..64
              Rakefile.rb on lines 72..81
              Rakefile.rb on lines 88..98

              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 46.

              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 5 locations. Consider refactoring.
              Open

              task :deploy_htacess => :build do
                require 'net/ssh'
                require 'net/scp'
              
                server = 'jonniespratley.me'
              Severity: Major
              Found in Rakefile.rb and 4 other locations - About 55 mins to fix
              Rakefile.rb on lines 20..29
              Rakefile.rb on lines 38..48
              Rakefile.rb on lines 55..64
              Rakefile.rb on lines 72..81

              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 46.

              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 HH has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  function HH(a, b, c, d, x, s, ac) {
              Severity: Major
              Found in app/libs/md5.js - About 50 mins to fix
                Severity
                Category
                Status
                Source
                Language