fga-eps-mds/2019.2-Vsign

View on GitHub

Showing 20 of 511 total issues

Function render has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        const stepSize = (100 / (this.props.script).length)
        const steps = [
            {
                selector: '[data-tour="step0"]',
Severity: Major
Found in frontend/src/components/RecordPage/index.js - About 3 hrs to fix

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

    export default function Instructions() {
        return (
            <div className="container">
                <div className="row">
                    <div className="col-12">
    Severity: Minor
    Found in frontend/src/components/InstructionsPage/Instructions.js - About 1 hr to fix

      Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render() {
              const { Line } = Progress;
      
              return (
                  <Fragment>
      Severity: Minor
      Found in frontend/src/components/DocumentPage/index.js - About 1 hr to fix

        Function renderActions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            renderActions() {
                if (this.state.successfullUploaded) {
                    return (
                        <Button
                            style={{
        Severity: Minor
        Found in frontend/src/components/DocumentPage/index.js - About 1 hr to fix

          Function render has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render() {
                  let { location } = this.props;
          
                  let isModal = !!(
                  location.state &&
          Severity: Minor
          Found in frontend/src/components/Script.js - About 1 hr to fix

            Function SigningSteps has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function SigningSteps(history) {
                let url =  history.history.location.pathname;
                let current = 0;
                
                switch (url) {
            Severity: Minor
            Found in frontend/src/components/Shared/SigningSteps/index.js - About 1 hr to fix

              Function HowItWorks has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function HowItWorks() {
                  return (
                      <Section id="como-funciona">
                          <FlexboxGrid justify="space-around">
                              <FlexboxGrid.Item colspan={15}>
              Severity: Minor
              Found in frontend/src/components/LandingPage/HowItWorks.js - About 1 hr to fix

                Method gettext has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def gettext(document_photo)
                    client = Aws::Rekognition::Client.new({
                      region: Rails.application.credentials.dig(:aws, :region),
                      credentials: Aws::Credentials.new(
                        Rails.application.credentials.dig(:aws, :access_key_id),
                Severity: Minor
                Found in backend/app/jobs/id_check_job.rb - About 1 hr to fix

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

                  const LandingPage = () => {
                      const [loginModal, setLoginModal] = useState(false);
                      const [email, setEmail] = useState('');
                      const [password, setPassword] = useState('');
                      return (
                  Severity: Minor
                  Found in frontend/src/components/LandingPage/LandingPage.js - About 1 hr to fix

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

                        render() {
                            return (
                                <div>
                                    <div className="show-fake-browser navbar-page">
                          <Container>
                    Severity: Minor
                    Found in frontend/src/components/ScriptPage/teste.js - About 1 hr to fix

                      Method gettext has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def gettext(document_photo)
                          client = Aws::Rekognition::Client.new({
                            region: Rails.application.credentials.dig(:aws, :region),
                            credentials: Aws::Credentials.new(
                              Rails.application.credentials.dig(:aws, :access_key_id),
                      Severity: Minor
                      Found in backend/app/jobs/id_check_job.rb - 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 sendRequest has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          sendRequest(file) {
                              return new Promise((resolve, reject) => {
                                  const req = new XMLHttpRequest();
                      
                                  req.upload.addEventListener("progress", event => {
                      Severity: Minor
                      Found in frontend/src/components/DocumentPage/index.js - About 1 hr to fix

                        Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function registerValidSW(swUrl, config) {
                          navigator.serviceWorker
                            .register(swUrl)
                            .then(registration => {
                              registration.onupdatefound = () => {
                        Severity: Minor
                        Found in frontend/src/serviceWorker.js - About 1 hr to fix

                          Function componentDidMount has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              componentDidMount() {
                          
                                  // instantiate Video.js
                                  this.player = videojs(this.videoNode, videoJsOptions, () => {
                                      // print version information at startup
                          Severity: Minor
                          Found in frontend/src/components/RecordPage/Video.js - About 1 hr to fix

                            Function Pricing has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function Pricing() {
                                return (
                                    <PricingSection id="precos">
                                        <FlexboxGrid justify="center">
                                            <FlexboxGrid.Item colspan={15}>
                            Severity: Minor
                            Found in frontend/src/components/LandingPage/Pricing.js - About 1 hr to fix

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

                              function* handleUploadImages() {
                              
                                  const { images } = yield select(state => state.record);
                                  const selectedImages = shuffle(images).slice(0, 3);
                                  
                              Severity: Minor
                              Found in frontend/src/sagas/upload.js - About 1 hr to fix

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

                                export default function upload(state = initial, action) {
                                    switch (action.type) {
                                        case SET_VIDEO_UPLOAD_STATUS:
                                            return {
                                                ...state,
                                Severity: Minor
                                Found in frontend/src/reducers/upload.js - About 1 hr to fix

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

                                  export default function Navbar() {
                                      return (
                                          <header>
                                              <nav className="navbar navbar-expand-lg navbar-dark bg-info py-4">
                                                  <div className="container">
                                  Severity: Minor
                                  Found in frontend/src/components/Shared/Navbar.js - About 1 hr to fix

                                    Function _SecondRow has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const _SecondRow = () => {
                                        return (
                                            <div>
                                                <SecondRow>
                                                    <AboutDiv>
                                    Severity: Minor
                                    Found in frontend/src/components/LandingPage/LandingPage.js - About 1 hr to fix

                                      Method what_document? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def what_document? ()    
                                          attrs = {
                                            image: {
                                              s3_object: {
                                                bucket: Rails.application.credentials[Rails.env.to_sym][:aws][:bucket],
                                      Severity: Minor
                                      Found in backend/app/jobs/id_confirm_job.rb - About 45 mins 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language